Thursday, August 27, 2009

Directadmin - MySql move a database and grant user permission

So to move a Mysql database from one server to another all you have to do is copy the database over and then grant the appropriate permissions to the new database on the new server.

In the example below the username is da_admin and password kbjlms1X

the database name is aurorafcs_md
the database user name is also aurorafcs_md
the database user password is gggyro33

To grant the permissions:
2. [root@ns2 conf]# mysql -uda_admin -pkbjlms1X
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 6118
Server version: 5.0.37-standard MySQL Community Edition - Standard (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> grant all privileges on aurorafcs_md.* to aurorafcs_md@localhost identified by 'gggyro33';
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> quit
Bye

No comments: