How to enable remote connection for MySQL database (multiple backups)

Source: Internet
Author: User
Note the following three points when enabling the remote login account of MySQL: 1. Check that 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

Note the following three points when enabling the remote login account of MySQL: 1. Check that 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

Note the following three points when enabling the MySQL remote login account:

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. Make sure that the dongle and so on do not intercept the IP address of our backup server

If your server has installed dongle and other security software, please add our backup server IP address 115.28.36.60 and other backup server IP addresses to the White List.

3. Added support for remote connection to MySQL users and authorization.

1) log on to the server and enter the command line.
On a Windows host, click the Start Menu, run, and enter "cmd" to enter the command line.

2) log on to the mysql console with the database administrator account. Run mysql-u root-p on the command line and enter the password to enter the mysql console.
Example: MySQL-uroot-p123456

123456 is the password of the root user.

3) create a remote login user and authorize the user. Continue to execute the following statement on the console.
Grant select, lock tables on demodb. * to deoffset @ '1970. 28.36.60 'identified by 'your password ';

Explanation: demodb = database name; deshortname = database username; your password = Database password

For example:

Grant select, lock tables on discuz. * to ted @ '1970. 28.36.60 'identified by '123 ′;

4) after the preceding statement is executed, the following statement can take effect immediately.
Flush privileges;

Explanation:

Grant select, lock tables on discuz. * to ted @ '1970. 28.36.60 'identified by '123 ′;

The preceding statement authorizes the select and locked permissions of the discuz database to the ted user, allows the ted user to remotely log on to the IP address 115.28.36.60, and sets the ted user password to 123456.

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. * ", grant permissions to a table in 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.

115.28.36.60 indicates the IP address that allows remote connection. If you want to restrict the IP address, set it to "%.

Note:

115.28.36.60 is an IP address of our backup server. It is mainly used to test whether our server can connect to your database.

Many of you may have questions about whether it will be unsafe. In fact, don't worry, because first, you only authorize our servers to connect to your database. Second, our server only has the select and lock permissions, that is, the query and lock table permissions, so you cannot change your database.


If you are not at ease, You can execute select host, user from user on the mysql console; check the content in the user table, because the user who enables mysql remote logon is stored in the user table 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: info-contact@alibabacloud.com 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.