Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
migrating mysql to an other server
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
akb
Guru
Guru


Joined: 25 Jan 2003
Posts: 314
Location: Wolfenbüttel/Germany

PostPosted: Sat Oct 07, 2006 4:33 pm    Post subject: migrating mysql to an other server Reply with quote

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
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Sun Oct 08, 2006 2:00 am    Post subject: Reply with quote

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
View user's profile Send private message
akb
Guru
Guru


Joined: 25 Jan 2003
Posts: 314
Location: Wolfenbüttel/Germany

PostPosted: Sun Oct 08, 2006 2:07 am    Post subject: Reply with quote

this also copies the user+rights? didnt know it is stored in the db itself...
Back to top
View user's profile Send private message
pteppic
l33t
l33t


Joined: 28 Nov 2005
Posts: 781

PostPosted: Sun Oct 08, 2006 8:09 am    Post subject: Reply with quote

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
View user's profile Send private message
Mad Merlin
Veteran
Veteran


Joined: 09 May 2005
Posts: 1155

PostPosted: Sun Oct 08, 2006 9:20 am    Post subject: Reply with quote

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
View user's profile Send private message
akb
Guru
Guru


Joined: 25 Jan 2003
Posts: 314
Location: Wolfenbüttel/Germany

PostPosted: Sun Oct 08, 2006 3:10 pm    Post subject: Reply with quote

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
View user's profile Send private message
magic919
Advocate
Advocate


Joined: 17 Jun 2005
Posts: 2182
Location: Berkshire, UK

PostPosted: Sun Oct 08, 2006 5:06 pm    Post subject: Reply with quote

mysql -p -u root

log in

show databases;

use mysql;

show tables;

select USER, HOST, WHATEVER FROM USER;
Back to top
View user's profile Send private message
akb
Guru
Guru


Joined: 25 Jan 2003
Posts: 314
Location: Wolfenbüttel/Germany

PostPosted: Sun Oct 08, 2006 5:32 pm    Post subject: Reply with quote

yes, i got it now. i had to flush the privileges for mysql to notice the manual (imported) changes:

Code:
FLUSH PRIVILEGES ;


thx anyway :-)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum