Knowledge base
1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
MySQL prefix
This guide explains what the "MySQL prefix" option in a site's parameters is for and what the implications are for running your Web applications (CMS) and PHP scripts.
Definition
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 the users of your MySQL database. A PHP script can therefore connect to MySQL with the user "myuser" and a database "mybase" and access will be automatic with the user "wxyz_myuser" and the database "wxyz_mybase".
Disabling the MySQL Prefix option
- Open the admin console (https://login.infomaniak.com)
- Go to Hosting
- Click on the hosting/domain name concerned
- On the hosting dashboard, under Sites, click on the domain name of the site concerned
- Enable or disable the MySQL Prefix option
- Make the necessary adjustments in the configuration files for your Web applications and PHP scripts
Implications and adjustments to be made
After disabling theMySQL Prefix option for a site, some PHP or CMS scripts may not work. In order to re-establish the connection to your databases, it is essential that you update the following information in the configuration file(s) of the scripts concerned:
- The name of the MySQL database
- Before: mybase
- After: wxyz_mybase
- The user of the MySQL database: the prefix of your server must be added
- Before: myuser
- After: wxyz_myuser
Additional help
- To display or modify the name of a database as well as its users: https://faq.infomaniak.com/1981
- To update connection information for a WordPress MySQL database: https://faq.infomaniak.com/2072