99

I know how to export/import the databases using mysqldump & that's fine but how do I get the privileges into the new server.

For extra points, there are a couple of existing databases on the new one already, how do I import the old servers privileges without nuking the couple existing of ones.

Old server: 5.0.67-community

New server: 5.0.51a-24+lenny1

EDIT: I've got a dump of the db 'mysql' from the Old Server & now want to know the proper way to merge with the 'mysql' db on the New Server.

I tried a straight 'Import' using phpMyAdmin and ended up with an error regarding a duplicate (one that I've already migrated manually).

Anyone got an elegant way of merging the two 'mysql' databases?

Gareth
  • 8,573
  • Is it a requirement for you to use PHPMyAdmin?
  • If it is I will write some PHPMyAdmin specific instructions for you.
    2. From PHPMyAdmin if you try to "select * from mysql.user limit 1;" do you get results or an error.

    – Bruno Bronosky Jun 11 '09 at 20:35
  • 1
    As I mentioned below, I think Richard's mygrants script is a good way to get grant info. However, you can also try editing the dump file to comment out INSERTs to the user table for users who already exist. Privileges for the dbs restored from the old server will then be copied. If you've already assigned privileges manually for some of the dbs you restored to the new box, look for these table names in the privilege files and comment these out, too. Don't forget a flush_privileges afterwards. Good description of the mysql db at: http://www.grahamwideman.com/gw/tech/mysql/perms/index.htm – nedm Jun 13 '09 at 10:37