Allow MySQL database server to support remote connection

Source: Internet
Author: User

As we all know,MySQL databaseMySQL Database Server is a widely used database system.Remote connectionIs an upgrade of the MySQL database server.

After the MySQL database server is installed on CentOS, the system does not allow you to connect to the database server through a non-local machine by default for security reasons, if you want to connect to the database server from another machine, you must manually modify it:

1. Run mysql-u root-p mysql on the console. The system prompts you to enter the password of the root user of the database. After the password is entered, the mysql console is displayed. The first mysql command of this command is to execute the command, the second mysql is the system data name, which is different.

2. ON the mysql console, run grant all privileges on *. * TO 'root' @ '%' identified by 'mypassword' with grant option;

3. Run The 'root' @ '%' command on the mysql console to understand that "root" is the user name and "%" is the host name or IP address. "%" here represents any host or IP address, you can also replace it with any other user name or specify a unique IP address. 'mypassword' is the password for authorized users to log on to the database; in addition, it should be noted that I here are to authorize all permissions, you can specify part of the permissions, GRANT specific operation details see: http://dev.mysql.com/doc/refman/5.1/en/grant.html

4. If you are not at ease, You can execute select host and user from user on the mysql console. Check the content in the user table, as shown in my check:

The implementation of the remote connection of the MySQL database can be completed as described in the previous article. The remote connection of the MySQL database can be achieved, and the connection between various computers is good, so that you can easily communicate with each other.

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.