Installation and remote settings of MySQL in Linux

Source: Internet
Author: User

1. Installing mysql in Linux is simple.
# Apt-get install mysql-server-5.0
After installation, set the password. If the password is 'sa'

2. After the installation is complete, log on to the Local Machine
# Mysql-u root-p
Enter the password
This is generally normal [6688 e-commerce website www.6688.cc]

However, a problem has been found recently. It is normal to log on to the local computer, but on other computers, mysql connected to linux always reports
Can't connect to MySQL server on '192. 168.162.129 '(192) Error
192.168.162.129 this is the linux ip address. The linux Server can be pinged to the Internet, and the linux Server can be pinged to the Internet.

After searching on the internet, I configured a statement in the/etc/mysql/my. cnf file.
Bind-address = 127.0.0.1
This sentence means that, in consideration of security, only listening to the connection of the Local Machine
The solution on the Internet is to annotate this sentence, or change it to bind-address = 0.0.0.0.

However, after I comment out the line,
When I use mysql administrator on xp to connect to mysql on linux, an error is returned.
1130 Host 'xx. XX. XX. xx' is not allowed to connect to the mysql server

This is because mysql does not allow remote connection by default.
Authorize this host.

There are two methods
1. grant authorization
If you want to authorize 192.168.1.91
Advanced to mysql
Then use
Mysql #> grant all privileges on *. * TO 'root' @ '92. 168.1.91 'identified by 'youpassword' with grant option;
After modification, remember to use flsh for privileges.
Mysql> flush privileges

Second, modify the table
Mysql> update user set host = '%' where user = 'root ';
Mysql> flush privileges;
Then use mysql administrator of xp to connect.

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.