Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Manage the "MySQL prefix
This guide explains what the "MySQL Prefix" option is for in a site's settings and what its implications are 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_
" in front of the name and users of your MySQL databases. - A PHP script can thus connect to MySQL with the user "monuser" and a database "mabase" and access will automatically be granted 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 case of migration of your hosting to another server, it is strongly recommended to disable this function and make the necessary adjustments.
Manage 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 name assigned to the product concerned:
- Click on Manage under Advanced Settings:
- Click on the PHP / Apache tab.
- Turn the toggle switch MySQL Prefix on or off.
- 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 the prefix of your server to it
- before:
mabase
- after:
wxyz_mabase
- before:
- The MySQL database user: you will need to add your server prefix to it
- before:
monuser
- after:
wxyz_monuser
- before:
Link to this FAQ: