How to enableMySQL databaseOfRemote Login AccountThis is a difficult issue and a problem that we often encounter at work. In order to complete the work, it is necessary for you to master how to enable the remote login account of the MySQL database, the following two steps are summarized in the work and practice, which can help DBAs successfully start the remote login account of the MySQL database.
1. Check whether the firewall on the server does not block port 3306.
The default port of MySQL is 3306. Make sure that the firewall does not block port 3306. Otherwise, the remote connection to MySQL cannot be established through port 3306.
If you specify another port when installing MySQL, enable the port used by MySQL in the firewall.
If you do not know how to set up a firewall on your server, contact your server administrator.
2. Added support for remote connection to MySQL users and authorization
1) first log on to MySQL with the root account
On the Windows host, click the Start Menu, run, enter "cmd", enter the console, MySQL bin directory, and then enter the following command.
On the Linux host, enter the following command in the command prompt line.
> MySQL-uroot-p123456
CODE: [COPY]
> MySQL-uroot-p123456
123456 is the password of the root user.
2) create a remote login user and authorize
> Grant all PRIVILEGES on discuz. * to ted @ '2017. 123.123.123 'identified by '123 ';
The preceding statement grants all permissions of the discuz database to the ted user, allows the ted user to remotely log on to the IP address 123.123.123.123, and sets the ted user password to 123456.
The following describes all the parameters one by one:
All PRIVILEGES indicates that all permissions are granted to the specified user. Here, you can also replace it with a specific permission, such as select, insert, update, delete, create, and drop, separate specific permissions with commas.
Discuz. * Indicates the table to which the preceding Permission applies. discuz indicates the database, and * indicates all the tables. Therefore, we can infer that: authorize "*. * ", authorize all tables of a database to" database name. * ", authorize a table of a database as" database name. table name ".
Ted indicates the user you want to authorize. This user can be an existing user or a non-existing user.
123.123.123.123 indicates the IP address that allows remote connection. If you want to restrict the IP address, set it to "%.
123456 is the user's password.
Follow the steps described above. We believe that you will be able to enable the remote login account of the MySQL database. I hope the content mentioned above will be helpful to everyone.