- How do I create a MySQL database?
- How do I change the login information or manage users for MySQL/MSSQL databases in my hosting account?
- How do I test MySQL connectivity?
- How do I backup my MySQL databases?
1. How do I create a MySQL database?
- Logged into the Plesk Control Panel for the hosting plan you want to modify
- Click “Databases” on the left side of the page.
- Click the "Add Database" button, which will load the screen shown below.
- Enter a Database name in the “Database name” field.
- Create a database user
- Set a database user name
- Set a password for the newly-created user
- Leave all other fields on this page as their default values.
- Click “OK”
2. How do I change the login information or manage users for MySQL/MSSQL databases in my hosting account?
Databases are created on the domain level through the Databases menu in Plesk.
These databases can be assigned separate database user accounts as follows:
- Open the Plesk Control Panel
- Click Database on the left followed by User Management
- To add a new user click Add Database User. To edit an existing user click on the Username.
NOTE: The user names and passwords for user accounts created in this manner are case-sensitive.
3. How do I test MySQL connectivity?
- Create a new blank text file (Can also be done directly in Plesk File Manager)
-
Copy and paste the below text into a blank text file.
<?php $db = "Database name"; #Database name $user = "Database username"; #Database username $pass = "Database password"; #Database password $host = "Database server"; #Database server $link = mysqli_connect($host, $user, $pass, $db); if (!$link) { echo "Error: Unable to connect to MySQL." . PHP_EOL; echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL; echo "Debugging error: " . mysqli_connect_error() . PHP_EOL; exit; } echo "Success: A proper connection to MySQL was made." . PHP_EOL; echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL; mysqli_close($link); php?>
- Fill in the database name, database username, database password and database server fields.
- Once you have updated the file with the appropriate information, save it as SQLtest.php and upload it to your hosting account (see Web Hosting: Upload Files to Web Hosting Account). Then, run the script by navigating to the file in a web browser (e.g., "http://www.mydomain.com/SQLtest.php").
If all the information was entered correctly, you should receive the message, "Success: A proper connection to MySQL was made." If you receive an error message, double-check the information that you entered into the script. If you still can't connect, please submit a Help Request through our Help Center and include the error message you received.
4. How do I backup my MySQL databases?
To export a backup of your existing MySQL database follow the instructions below:
- Log into the control panel for your hosting account.
- Click Databases on the left.
- Under the database that you want to back up, click on Export Dump
- Export Dump: Review the information in the export dump pop up and click OK
- Save the dump to the following directory: You can select a directory. By default, the file will be saved to the root.
- Dump file name: By default, the file name will be DATBASE_NAME_Year-Month-Day_HR-MN-S.sql.zip
- Automatically Download Dump After Creation: This should be checked.
- It will take time to export and compress the database you can view the status in the lower right.
- When complete, the download will start automatically. If it does not, you can start the download by clicking download link in the status window in the lower right.
Comments
0 comments
Please sign in to leave a comment.