Mysql database How to turn on remote connections (multiple backups) _mysql

Source: Internet
Author: User
Tags mysql in

Open MySQL Remote login account need to note the following 3 points:

1, make sure that the firewall on the server does not block 3306 ports.
MySQL default port is 3306, you need to determine that the firewall does not block 3306 ports, or remote can not connect through 3306 ports to MySQL.

If you specified a different port when installing MySQL, open the port number that you specified in MySQL in the firewall.

If you do not know how to set up a firewall on your server, please consult your server administrator.

2. Make sure that the security dog does not intercept our backup server IP

If you have security-like software installed on your server, please add our backup server IP and other backup server IP to whitelist.

3, increase allow remote connection MySQL user and authorization.

1 log on to the server side and enter the command line.
The Windows host is clicked Start menu, Run, enter "cmd", enter command line.

2 to the Database administrator account to enter the MySQL console. Execute the mysql-u root-p password at the command line and enter the MySQL console when you are finished.
For example: mysql-uroot-p123456

123456 is the password for the root user.

3 Create a remote login user and authorize the following statement to continue at the console.
Grant Select,lock tables on demodb.* to demouser@ '′identified by ' your password ';

Explanation: demodb= database name; demouser= database user name; your password= database password

For example:

Grant Select,lock tables on discuz.* to ted@ '′identified by ' 123456′;

4 executes the above statement, then executes the following statement before it can take effect immediately.
Flush privileges;

Small series Explanation:

Grant Select,lock tables on discuz.* to ted@ '′identified by ' 123456′;

The above statement indicates that the select,locked permission to the Discuz database is granted to the user of Ted, allowing the TED user to remotely log in this IP and set the TED user's password to 123456.

discuz.* indicates which table the above permissions are for, discuz refers to the database, and the following * means that for all tables, it is possible to infer that all tables for all databases are authorized to be "*.*" and that all tables of a database are authorized to "database name. *", A table for a database is authorized as the database name. Table name.

Ted says which user you want to authorize, this user can be a user who exists, or it can be a non-existent user. represents an IP address that allows remote connections, or "%" if you want to not restrict the link's IP.

Attention: is one of our backup server IPs, which is primarily used to test whether our servers can connect to your database.

Many friends here will have questions, this will not be safe, in fact, do not worry, because first of all, you just authorize our server to connect your database, and secondly, our server has only select and lock permissions, that is, Query and lock table permissions, so completely can not change your database.

You can perform a select host, user from user, in the MySQL console, and check the contents of the user table. Because users that open MySQL remote logins are stored in the user tables in the MySQL database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.