MySQL Database remote Connection open method

Source: Internet
Author: User

The first method: more detailed
The following article mainly introduces the MySQL database to open the time of the remote connection operation process, in fact, the actual operation of the remote connection to the MySQL database is not difficult, the knowledge method is wrong, today we want to describe the MySQL database to open the time of the remote connection operation process.

d:\MySQL\bin\>--

This should allow access to the MySQL server

 mysql>  update  user  set  host =   " %  "  where  user  =   " root  "  Span style= "COLOR: #000000" >; MySQL  >  select  host, user  from  user ; 
MySQL>GRANTallprivilegeson*. *  to ' Root '@ '%' by'mypassword'  with GRANT OPTION
Permission to access data to any host

3.

MySQL>Privileges


Changes take effect

4, Mysql>exit

Log out of MySQL server

This will allow you to log in as root on any other host!

The above related content is the MySQL database to open the remote connection of introduction, hope you can have some gains.

The second method:
1, in the console to perform mysql-u root-p MySQL, the system prompts for the password of the root user of the database, entered after the completion of the MySQL console, the first command of MySQL is to execute the command, the second MySQL is the system data name, not the same.

2. On the MySQL console execute GRANT all privileges on * * to ' root ' @ '% ' identified by ' MyPassword ' with GRANT OPTION;

3, in the MySQL console execution command of ' root ' @ '% ' can understand: Root is the user name,% is the host name or IP address, where the% represents any host or IP address, you can also replace any other user name or specify a unique IP address; ' MyPassword ' is the password for the login database specified by the authorized user; Another thing to note is that I am here to authorize all permissions, you can specify some permissions, grant specific operation details see: http://dev.mysql.com/doc/refman/5.1/en/grant.html

4, do not rest assured that you can execute the select Host in the MySQL console, user from user; Check the contents of the user table

MySQL Database remote Connection open method

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.