How can I set up MySQL to get people to access the local database?

Source: Internet
Author: User

Locate the MySQL configuration file, search for "bind-address", and find this line:

bind-address = 127.0.0.1 in front add a #, comment out this line, save, restart MySQL.

Remote access is available, and Telnet can discover that the port is also open.

Example configuration:

1. Ensure that skip-networking is removed or blocked, otherwise TCP/IP access is not supported
2. Add line bind-address = 65.55.55.2, replace 65.55.55.2 as your server address

After modification, the configuration is:

[Mysqld]
user = MySQL
Pid-file =/var/run/mysqld/mysqld.pid
Socket =/var/run/mysqld/mysqld.sock
Port = 3306
Basedir =/usr
DataDir =/var/lib/mysql
Tmpdir =/tmp
Language =/usr/share/mysql/english
Bind-address = 65.55.55.2
# skip-networking

Save and close the configuration file
Restart MySQL server: #/etc/init.d/mysql restart

If the above method is not used we can set the general MySQL command mode:

It may be that your account is not allowed to log on remotely, only on localhost. This time, as long as the computer on the localhost, log in to MySQL, change the "MySQL" Database in the "User" table "host", from "localhost" to "%"

Code:mysql-u root-p123
Mysql>use MySQL;
Mysql>update User Set host = '% ' where user = ' root ';
Mysql>select host, user from user;

How can I set up MySQL to get people to access the local database?

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.