Quickly enable MySQL database server to support remote connection _ MySQL

Source: Internet
Author: User
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 allow the user to connect to the database server on another machine, you must manually modify it to install the MySQL database server on CentOS. for security reasons, by default, the user cannot connect to the database server through a non-local machine. to allow the user to connect to the database server through another machine, the user must be manually modified:

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:

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.