How to create MySQL secondary users

How to create MySQL secondary users

 
You can create secondary MySQL users from the control panel. This allows you to distribute management tasks among different users, assigning different permissions individually to each database.
 
If you need to view, modify, or delete your MySQL user data, select the MySQL Users icon in the advanced tools of your hosting:
 
 
In the first section of the screen, you can view the details of your main MySQL user:
 
 
In the section "MySQL database connection details", you have the following data and actions available:
  • Username: main MySQL username.
  • Host: Localhost (server where the database is located).
  • phpMyAdmin: direct link to the MySQL database manager.
  • Password: password assigned to the main MySQL user.
  • Concurrent connections: maximum allowed connections for the MySQL user.
  • Change password: with this button you can change the MySQL user password.
 
Next, you have the option to enable external access:


In the next section "List of secondary users for the MySQL database", you can create a secondary MySQL user by clicking the Create user option.
 
 
After clicking the Create user option, the following form will appear where you must enter the required information for the new MySQL user.


  • Username: name of the secondary user.
  • Password: you must enter a password between 8 and 64 characters.
  • Repeat Password: enter the password again to confirm it contains no errors.
  • Concurrent connections: select the number of concurrent connections for the user. This value will be deducted from the connections assigned to the main user.
  • External access: you can enable access so other IP addresses can connect to the database.
 
Once the user is created, you will be able to view the details entered for each user.
 
 
If you select the lock-shaped icon, you will be able to edit the user permissions so they can manage the databases you choose.
 
 
After clicking the lock icon, you will see the list of databases in your hosting. Using the Edit option you can manage permissions for each of them:
 
 
Once you select the Edit option, you must choose the operations that the secondary MySQL user will be allowed to perform:
 
 
Save the changes and you will return to the previous menu. If you want to modify the user details, select the icon shaped like a note with a pencil to edit the information.


In this section you can modify the username, password, enable external access, and modify the limit of simultaneous connections. Once the modifications are made, save the changes by clicking the Modify user button.
 
 
Finally, you will be able to use this user to access the phpMyAdmin application and also configure it to make connections through your programming to the Localhost server.
 
SSH access
 
If you have SSH access and want to connect to MySQL, you can do so using the following command:
 
mysql -u your_mysql_user -p -h your_hosting_IP
 
Remember that you must have external access to the database enabled.
 
 
For more information, you can contact us.
    • Related Articles

    • How to create FTP secondary users

      The Control Panelcdmonallows you to create secondary FTP users, to whom you can restrict access to certain folders. To create secondary users, you must go to themanagement of accommodationand in the 'File Managers' section access the optionFTP users. ...
    • How to create MySQL databases

      The use of dynamic pages or content management systems requires the use of MySQL databases. These databases can be created from the cdmon control panel. To create a database, first access the hosting management section. Once you access the hosting ...
    • How to create users from the Wordpress administrator

      On different occasions, we need to create new users to manage our WordPress due to the fact that we may need to grant access to a third party or because the WordPress site is managed by more than one person. In the following guide, we will show how ...
    • How to connect to a database with MySQL Workbench

      Below we explain step by step how to establish a connection to your MySQL database using MySQL Workbench, including the necessary screenshots to guide you during the process. 1. Download and installation of MySQL Workbench MySQL Workbench is a free ...
    • How to change the MySQL user password

      To change the password for database access, we must go to the hosting where the database is installed. Next, go to the "Databases" column and access "MySQL Users" Once inside, go to the "MySQL database connection details" section and click on "Change ...