Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Manage the MySQL prefix
This guide explains the purpose of the "MySQL Prefix" option in a site's settings and its implications for the operation of your Web applications (CMS) and PHP scripts.
Preamble
- When the "MySQL Prefix" option is enabled for a site, it is no longer necessary to add the prefix "
wxyz_
" before the name and users of your MySQL databases. - A PHP script will thus be able to connect to MySQL with the user "monuser" and a database "mabase," and access will automatically be performed with the user "wxyz_monuser" and the database "wxyz_mabase".
- ⚠ If you are migrating from an older Infomaniak offer:
- After migrating a site from the old console, the "MySQL Prefix" option is enabled by default to automatically maintain the connection of your Web applications (WordPress, Joomla, Drupal, etc.) and PHP scripts with your MySQL databases.
- To ensure the proper functioning of your sites in the event of a migration of your hosting to another server, it is strongly recommended to disable this function and make the necessary adjustments.
Managing the MySQL Prefix Option
Going Further with Environment Variables
It is possible to configure environment variables directly from the Manager for your entire website:
- Click here to access the management of your product on the Infomaniak Manager (need help?).
- Click directly on the assigned name of the relevant product:
- Click on Manage under Advanced settings:
- Click on the PHP / Apache tab.
- Enable or disable the toggle switch MySQL Prefix.
- Click the Save button:
- Make the necessary adjustments in the configuration files of your Web applications and PHP scripts…
Implications and Adjustments to Make
After disabling the MySQL Prefix option for a site, some PHP scripts or CMS may no longer function. To restore the connection to your databases, you must update the following information in the configuration file(s) of the affected scripts:
- The name of the MySQL database: you will need to add your server's prefix
- before:
mabase
- after:
wxyz_mabase
- before:
- The user of the MySQL database: you will need to add your server's prefix
- before:
monuser
- after:
wxyz_monuser
- before:
Link to this FAQ: