Set mysql to allow Internet access

Source: Internet
Author: User

Set mysql to allow external access to the root account of mysql. I usually use localhost or 127.0.0.1 during connection. The mysql on the company's test server is also localhost, so the solution for www.2cto.com is as follows: 1, modify the table, log on to the mysql database, switch to the mysql database, and use the SQL statement to view "select host, user from user;" mysql-u root-pvmwaremysql> use mysql; mysql> update user set host = '%' where user = 'root'; mysql> select host, user from user; mysql> flush privileges; Note: The last sentence is very important, the purpose is to make the modification take effect. if no data is written, remote connection is still unavailable. www.2cto.com 2, authorized user. You want to use the root password to connect to the mysql server from any host to grant all privileges on *. * TO 'root' @ '%' identified by 'admin123' with grant option; flush privileges; if you want to allow the user root to connect to the mysql server from the host with the ip address 192.168.1.104, grant all privileges on *. * TO 'myuser' @ '192. 168.1.104 'identified BY 'admin123' with grant option; flush privileges;

Related Article

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.