MySQL is an open-source relational database management system. Like other relational databases, MySQL stores data in tables consisting of rows and columns. Users can define, manipulate, control, and query data using the structured query language, more commonly known as SQL. To connect to a MySQL database remotely from your local system, your cPanel hosting provides the tool Remote MySQL that allows you to connect to your database remotely. This feature lets remote hosts access your account's databases.
Allow a Remote Connection to a MySQL Database
Before you can connect to your databases remotely, the IP address functioning through a remote connection must be authorized on your account's side. To allow a remote connection, please follow these steps: Access your cPanel account Go to the Remote MySQL menu in the Databases.
section On the next page, enter the domain name or IP address of the server hosting the web application. You can add a wildcard (%) to allow multiple IP addresses to access the database; for example, 192.68.0%. When using a wildcard, make sure to limit the scope to addresses under your control or that you are certain pose no security risk. Optional Comment: To remember the entry, you can write a remark.
To save the configuration, click on the Add Host button. Next, you need to configure your site to use the remote database. The process differs depending on the application. For example, on a WordPress newly installed site, you must first create the database in cPanel's MySQL database wizard. Then, modify the wpconfig file, as well as the domain name or server IP address. php du site WordPress pour inclure le nom de la base de données et les identifiants d'authentificationdefine( 'DB_NAME', 'wp_database' );define( 'DB_USER', 'user' );define( 'DB_PASSWORD', 'a-secure-password' );define( 'DB_HOST', '' ); 203.0.113.0
Connect to a MySQL Database Remotely
After enabling host access, you can connect to your MySQL databases remotely using a MySQL client application. For example, MySQL Workbench is an integrated tool environment that allows you to manage databases, execute queries, and much more. MySQL Workbench can be downloaded and used for free. There are versions for Microsoft Windows, Mac OS X, Linux, and other operating systems. To establish a connection to your remote database using MySQL Workbench, follow this guide