The text on this page was translated by translation software. A revised version from our editors will be available soon.
For Web Hosting Linux and Windows packages
Do you program yourself or do you need the code for the configuration file of your web application? As a 1&1 IONOS customer, you can simply download the code required to connect to your MySQL database in the form of code examples from the 1&1 IONOS. This code already contains most of the access data - all you need to do is enter your database password and you are ready to go.
Log in to 1&1 IONOS and select the relevant contract.
Select MySQL Database from the left menu bar under My Products.
Choose Actions > Code Samples (PHP).
Click on each tab to view PHP code examples for the MySQL extensions MySQL, MySQLi and PDO.
Copy and paste the code into your PHP script.
Enter your database password at the position indicated in the code.
Now you can upload the script to your web space and test it.
- For security reasons, the database server can only be reached in the 1&1 IONOS network. This means that the script does not work if you run it on your local PC, for example.
- If you no longer know your MySQL password, simply enter a new one in 1&1 IONOS.