Categories
Uncategorized

MySQL Migration

Moving over databases from a local installation to a shared database has been an interesting lesson in permission management. Typically I’m relying on WHM/cPanel to propagate permissions for me, and in this case I’m moving databases from an existing cPanel installation onto a remote database server. I created the databases manually and created the basic permission for the application (Joomla! CMS) to manage the table. All was well, but from the account dashboard you couldn’t see the tables from the phpMyAdmin manager. It appears that cPanel will create several permissions when the account has been initially provisioned with the remote database, but having moved the database, no amount of cPanel account or password tinkering in the UI seemed to affect the master account permissions to the table. In phpMyAdmin I would see just the information_schema table.

To solve the problem I created a user for the primary cPanel username, and then assigned it to the database. This was just one of the permissions I find in our other installations, but appears to be the only one required in this case.

CREATE USER '{cpanel_user}'@'192.168.1.%' IDENTIFIED BY '{password}';
GRANT ALL PRIVILEGES ON {database_name}.* TO '{cpanel_user}'@'192.168.1.%';