Mysql connection string-when the IP address used for remote connection is not just localhost

Source: Internet
Author: User
Tags mysql connection string

A remote machine is required to access a mysql database. The result is [MySQL] [ODBC 5.1 Driver] Can't connect to MySQL server on '192. 168.1.101 '(192)
 
The latest work und is as follows: (the most important step --> marked in red)
 
How to Prevent MYSQL database from accessing the local database using IP Address
After the MYSQL database is installed by default, if the default user name ROOT can only access the host in <localhost> or <127.0.0.1> mode, the following content is returned when accessing the host through an external IP address:
ERROR 1130 (): # HY000Host 'xxxxxx' is not allowed to connect to this MySQL server
You can add a user with the following permissions to allow external access by the LAN or the Internet:
1. Enter CMD at run, OK, and enter the text mode.
2. Enter mysql-h localhost-u root-p and press enter to log on as the ROOT user.
3. Enter use mysql; display Database changed, and select MYSQL system library.
4. Suppose we now add a 'goldeye2000' user with a password of '000000' so that it can access MYSQL from outside. Input
Grant all on * to 'goldeye2000 'identified by '20140901 ';
ALL indicates ALL permissions.
5. Now let's look at the user table content. Enter select user, host from user; you can see that the "goldeye2000" user has been added, and its permission is '%', 'grand', 'localhost '.
6. Log out of MYSQL, enter QUIT, and press Enter.
7. We can now use goldeye2000 users to access elasticsearch through IP addresses on the LAN or the Internet.
Mysql-h 192.168.0.115-u goldeye2000-p

2. Comment out bind-address = 127.0.0.1.

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.