How to Connect to MySQL Database
Follow the below steps to connect to MySQL database.
There are two ways to connect to MySQL database:
- Script
This process requires a configuration file to connect your script to the database.List of configuration files is available on our website. Talk to our representative for information on this, if you are unable to find this.Database driven scripts usually have default configuration files that let you provide appropriate information. For example:- Host Name = localhost
Enter your localhost name - Database Name = cpanelUsername_databaseName
Enter your database name. - Database Username = cpanelUsername_databaseName
Enter your database username. - Database Password = whatever you selected
Enter your database password
- Host Name = localhost
- Remote connection
- Access Control Panel.
- Select Databases>Remote MySQL.
- Enter the IP address, and click Add Host.
- Click Add.
Resetting Database Password
- Access Control Panel.
- Select MySQL Databases from the Databases section.
- The Current Users section is displayed. Click Set Password for the appropriate database user.
- The Set MySQL User Password screen is displayed. The Username is displayed by default. Enter your password in the Password and Re-enter Password fields, and click Change Password.
- A message is displayed stating that your password is changed successfully.
Connect to MySQL Database Remotely
- Access Control Panel
- Select Databases>Remote MySQL.
- Enter the IP address, and click Add Host.
- Click Add.
- A message is displayed stating the host IP address is added to the access list.
Creating MySQL Database and User
Creating MySQL Database
- Access Control Panel.
- Select Databases> MySQL Databases.
- In the New Database field, enter the database name, and click Create Database.
- You will be able to see this database name in the Current Databases list.
Deleting MySQL Database
- Go to MySQL Databases> Current Databases.
- Go to Actions column of the database that you want to delete, and select Delete Database.
Creating Database User
- Select Databases>MySQL Databases.
- In the Add New Users section, enter your database username and password. Re-enter your password in Re-enter Password field.
- Click Create User.
Deleting a Database User
- Go to MySQL Databases> Current Users.
- In the Delete column, click the ‘X’ icon next to the user you want to delete.