Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MYSQL on Gentoo Linux Databas Migration.

Status
Not open for further replies.

gb0mb

IS-IT--Management
May 30, 2007
177
US
Hello,

I need to move a MYSQL database used by our php website.

I am having trouble moving this. Anyone suggest a tool that might help.

Someone had mentioned mysqldump.

I would like to get all MYSQL account info migrated also,
so I do not even need to recreate the mysql authentication that the php script uses.

Thanks

Gb0mb

........99.9% User Error........
 
You could try:
[tt]
mysqldump -h oldhostname -u oldusername -poldpassword dbname \
| mysql -h newhostname -u newusername -pnewpassword dbname
[/tt]
However, if the target server version is older than the current server, you might need to split that command into two; first dump the db to a file, then edit out any syntax incompatibilities, then upload it.

The MySQL user information is contained in the "mysql" database, which can be transferred as shown above. However, a newer server version could well have extra fields in some of the tables, which the above one-step procedure will wipe out. To avoid that you might need to use the three-step process, editing the files to retain the table structures. Or there might be flags in mysqldump that you could use to achieve the same result.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top