February 4th, 2017
4:21 pm
Zen MySQL Hosting and Permission Issues

Posted under Hosting
Tags , ,

cPanel MySQL access is provided by the phpMyAdmin application.

When creating MySQL databases for different applications, each get their own database schema and user, but their is also a master user which has the same username and password as the cPanel hosting (in my case, swoodley/…..).

This is relevant as I have found during upgrading some hosted software where a database upgrade script needs to be run, sometimes the script fails when run under the username for the specific schema with permission errors e.g. on alter table, even though the user has full permissions. This occurred in particular when upgrading Mantis BT. This appears to be because the script in question contains specific database schema references when referring to tables, of the form mydb.tablename. This kind of reference fails when run using the login account for the particular database schema.

Logging in using the master user solved the problem. It may be that modifying the script to take out specific schema references may then allow it to work with the schema/database account rather than the master one. However, this was not necessary in my case.

No Comments »