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 the settings of a website and its implications for the operation of your web applications (CMS) and PHP scripts.
Definition
When the "MySQL Prefix" option is enabled for a website, it is no longer necessary to add the "wxyz_" prefix in front of the name and users of your MySQL databases. A PHP script can connect to MySQL with the user "myuser" and a database "mydatabase," and access will automatically be done with the user "wxyz_myuser" and the database "wxyz_mydatabase."
Managing the MySQL Prefix Option
To access the management of the website:
- Log in to the Infomaniak Manager (manager.infomaniak.com) using a web browser such as Brave or Edge
- Click on the icon in the top right corner of the interface (or navigate through the left side menu, for example)
- Select Website (Web & Domain universe)
- Click on the name of the relevant object in the displayed table
- Click on the blue button Advanced Settings
- Click on the PHP tab
- Enable or disable the MySQL Prefix option
- Click on the blue button Save
- 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 website, some PHP scripts or CMS may no longer work. To restore the connection to your databases, you will need to 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
- Before: mydatabase
- After: wxyz_mydatabase
- The user of the MySQL database: you will need to add the prefix of your server
- Before: myuser
- After: wxyz_myuser