View previous topic :: View next topic |
Author |
Message |
akb Guru

Joined: 25 Jan 2003 Posts: 314 Location: Wolfenbüttel/Germany
|
Posted: Sat Oct 07, 2006 4:33 pm Post subject: migrating mysql to an other server |
|
|
hi there,
i am moving a few sites to an other root server at the moment and now want to replicate the mysql user rights too. but how do i do this? i took a look at the database and thought it should be enough to copy the corresponding entries from mysql.db and mysql.user, but i was wrong. i had to manually grant access on the testing database though i had copied these entries over to the new one...
edit: i want to do it one domain after the other, because i want to make sure every single domain runs perfectly... |
|
Back to top |
|
 |
Mad Merlin Veteran

Joined: 09 May 2005 Posts: 1155
|
Posted: Sun Oct 08, 2006 2:00 am Post subject: |
|
|
If you're running the same version of MySQL on every server, simply do a full mysqldump of every database and then import the complete dump everywhere else. _________________ Game! - Where the stick is mightier than the sword! |
|
Back to top |
|
 |
akb Guru

Joined: 25 Jan 2003 Posts: 314 Location: Wolfenbüttel/Germany
|
Posted: Sun Oct 08, 2006 2:07 am Post subject: |
|
|
this also copies the user+rights? didnt know it is stored in the db itself... |
|
Back to top |
|
 |
pteppic l33t

Joined: 28 Nov 2005 Posts: 781
|
Posted: Sun Oct 08, 2006 8:09 am Post subject: |
|
|
akb wrote: | this also copies the user+rights? didnt know it is stored in the db itself... |
AFAIK they are stored in the confusingly named (for explanation purposes) mysql database called mysql.
It may require some tweaking if access is assigned by a FQDN or specific machine-name/ip-address though. |
|
Back to top |
|
 |
Mad Merlin Veteran

Joined: 09 May 2005 Posts: 1155
|
Posted: Sun Oct 08, 2006 9:20 am Post subject: |
|
|
akb wrote: | this also copies the user+rights? didnt know it is stored in the db itself... |
That's correct. Inspect the mysql database within mysql as root to see for yourself. _________________ Game! - Where the stick is mightier than the sword! |
|
Back to top |
|
 |
akb Guru

Joined: 25 Jan 2003 Posts: 314 Location: Wolfenbüttel/Germany
|
Posted: Sun Oct 08, 2006 3:10 pm Post subject: |
|
|
pteppic wrote: | akb wrote: | this also copies the user+rights? didnt know it is stored in the db itself... |
AFAIK they are stored in the confusingly named (for explanation purposes) mysql database called mysql.
It may require some tweaking if access is assigned by a FQDN or specific machine-name/ip-address though. |
yes, i thought so too. but even after setting this entries to be correct, i didnt get access to the db. i had to manually grant access again.
Mad Merlin wrote: | That's correct. Inspect the mysql database within mysql as root to see for yourself. |
which commands should i use? i am looking at it atm, but there is at least no additional table within the db or something like that, so i dont know where (how) to look. |
|
Back to top |
|
 |
magic919 Advocate

Joined: 17 Jun 2005 Posts: 2182 Location: Berkshire, UK
|
Posted: Sun Oct 08, 2006 5:06 pm Post subject: |
|
|
mysql -p -u root
log in
show databases;
use mysql;
show tables;
select USER, HOST, WHATEVER FROM USER; |
|
Back to top |
|
 |
akb Guru

Joined: 25 Jan 2003 Posts: 314 Location: Wolfenbüttel/Germany
|
Posted: Sun Oct 08, 2006 5:32 pm Post subject: |
|
|
yes, i got it now. i had to flush the privileges for mysql to notice the manual (imported) changes:
thx anyway  |
|
Back to top |
|
 |
|