Hi,
Here are the steps I have done to add some databases from the another server:
Step 1. Imported the databases via SQL using phpMyAdmin
Step 2. Created a database user from cPanel
Step 3. Run the following command from SSH
/usr/local/cpanel/bin/dbmaptool ACCOUNT_USER --type mysql --dbs MY_DATABASE --dbusers DB_USER
But I there are two problems with this approach:
1. After running dbmaptool from "step 3." above, was able to let cPanel display the databases. But it did not assign the DB_USER to the database. Database connection will only work if I run the GRANT ALL PRIVILEGES command from MySQL client to this user, but still does not display the user assigned to the database in cPanel.
Is something missing here?
2. All imported databases are displaying database size as 0, although there are tables and data in it. This doesn't happen when a database is created from cPanel itself.
I have already tried running
/scripts/update_db_cache
but without luck.
Although there aren't any problems if everything was done within cPanel, I would like to run the commands from SSH, so it can be automated without needing any manual intervention.
Thank you.
Here are the steps I have done to add some databases from the another server:
Step 1. Imported the databases via SQL using phpMyAdmin
Step 2. Created a database user from cPanel
Step 3. Run the following command from SSH
/usr/local/cpanel/bin/dbmaptool ACCOUNT_USER --type mysql --dbs MY_DATABASE --dbusers DB_USER
But I there are two problems with this approach:
1. After running dbmaptool from "step 3." above, was able to let cPanel display the databases. But it did not assign the DB_USER to the database. Database connection will only work if I run the GRANT ALL PRIVILEGES command from MySQL client to this user, but still does not display the user assigned to the database in cPanel.
Is something missing here?
2. All imported databases are displaying database size as 0, although there are tables and data in it. This doesn't happen when a database is created from cPanel itself.
I have already tried running
/scripts/update_db_cache
but without luck.
Although there aren't any problems if everything was done within cPanel, I would like to run the commands from SSH, so it can be automated without needing any manual intervention.
Thank you.