phpMyAdmin is a web-based management tool for MySQL databases. It allows you to create and delete databases, create and modify tables, and run SQL scripts. This topic shows you how to use phpMyAdmin to connect to a MySQL database on a Linux-based Web Hosting instance.
Prerequisites
You have downloaded phpMyAdmin.
You can download it from the official phpMyAdmin website.
You have installed an FTP client.
We recommend using FileZilla. For more information, see Manage website files with FileZilla.
Background
The database connection configuration file name varies by phpMyAdmin version. Ensure you use the file name that matches your version.
phpMyAdmin versions have specific compatibility requirements for PHP versions. For more information, see the official phpMyAdmin website.
Select a compatible PHP version for your Web Hosting instance based on your phpMyAdmin version. For more information, see Change the PHP version.
Data Management (DMS), including both the DMS web console and the DMS client, has been discontinued and is no longer maintained. If you previously used DMS to manage your Web Hosting MySQL database and experience issues such as login failures, tool errors, or connection failures to your database address (for example, *.my3w.com:3306), switch to the phpMyAdmin method described in this topic or use a third-party client such as Navicat for MySQL.
Procedure
- Obtain database information.
- Log on to the Cloud Web Hosting management page.
- Find the Cloud Web Hosting instance for which you want to obtain database information and click Manage in the Actions column.
- In the navigation pane on the left, click Database Information.
- On the Database Information page, obtain database information.
In the Database Information section of the host management page, view information such as Database type (for example, Windows SQL Server 2008), Database name , Database address , and Database username . You can also perform operations such as resetting the password and managing the database.Note If you forget your database password, reset it. For more information, see Reset the Cloud Web Hosting database password.
Configure the database connection for phpMyAdmin.
Decompress the phpMyAdmin-5.1.1-all-languages installation package on your local host.
Open the phpMyAdmin-5.1.1-all-languages folder, locate the database connection configuration file config.sample.inc.php, and modify the database connection information in the file.
An example from config.sample.inc.php:
/* Server your.host.example.com (config:****) */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'your_database_address'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['AllowNoPassword'] = false; /* User used to manipulate with storage */ $cfg['Servers'][$i]['controlhost'] = 'your_database_address'; $cfg['Servers'][$i]['controlport'] = '3306'; $cfg['Servers'][$i]['controluser'] = 'your_database_username'; $cfg['Servers'][$i]['controlpass'] = 'your_database_password';Replace the placeholders in the code with your database information.
Save the modified database connection configuration file config.sample.inc.php, and rename the file to config.inc.php.
On your local host, recompress the files in the phpMyAdmin-5.1.1-all-languages installation package, and rename the compressed package to phpMyAdmin.
Linux-based Web Hosting instances can only decompress .zip and .tar files. We recommend compressing the installation files into a .zip package.
NoteMake sure that the phpMyAdmin-5.1.1-all-languages installation package is a single-level directory, which means the directory directly contains the component files. If the phpMyAdmin-5.1.1-all-languages installation package contains an extra directory layer, compress the files from that directory into a .zip archive, rename the archive to phpMyAdmin, and save it on your local computer for installation.
Use an FTP client to upload the phpMyAdmin archive to the website root directory of your Linux Web Hosting instance, /htdocs.
On the File Manager page of the Web Hosting console, unzip the phpMyAdmin compressed package.
For more information, see Compress and decompress files.
In the address bar of the browser on your local host, enter your domain name, and press the Enter key.
NoteIf your domain name is not ready, you can use the temporary domain name for testing.
On the phpMyAdmin page, enter your database username and password in the Login section, and then click Go.
Results
After you log on to phpMyAdmin, you can manage the MySQL database for your Web Hosting instance.
The phpMyAdmin homepage displays server connection information, such as Server version, Protocol version, and Character set. The navigation pane lists your databases.
FAQ
What do I do if my local database tool cannot connect to the Web Hosting MySQL database?
Troubleshoot the issue by checking the following:
Verify your connection credentials. Make sure the database address, username, and password are entered correctly. You can find the connection information in the Web Hosting console.
Check network connectivity. On your local computer, run
pingandtelnetcommands to verify the connection to your database address. For example:ping your_database_address.my3w.com telnet your_database_address.my3w.com 3306If the connection times out or is refused, a network or firewall restriction may be blocking access to the database port.
If the DMS client fails to connect, try the DMS web console as a fallback. If the issue persists, use the phpMyAdmin method described in this topic instead.