After MySQL is installed, only the following hosts are recognized: localhost and 127.0.0.1.

Source: Internet
Author: User

After MySQL is installed, only the following hosts are recognized: localhost and 127.0.0.1.

The only hosts recognized after MySQL is installed are localhost and 127.0.0.1. If you want to allow the IP address on your machine to log on normally, there are two methods:
First, authorize your IP address 172.16.1.10
Grant privileges on dbname. * to "user" @ "172.16.1.10" identified by "password ";

If you only use it, you can write it like this.
Grant all on *. * to "user" @ "172.16.1.10" identified by "password ";
 

For more information about grant, see the mysql user manual.

Mysql> use mysql;
Database changed

Mysql> desc user; check the number of fields
Mysql> insert into user values (val1, val2 ,....);
 
 
 
The second is to set the root user to be able to log on remotely, that is, to log on from any machine.
Mysql> use mysql;
Database changed
Mysql> update user set host = "%" where user = "root ";
 

Mysql> use mysql
Grant all on *. * to "root" @ "172.30.41.72" identified by "x0000304 ";
Restart mysql server
 
 
 
Method 3: run the following command directly in the mysql database management background:
Use mysql;
Grant all on *. * to "root" @ "172.30.41.95" identified by "x0000304 ";

-------------------------------------- Split line --------------------------------------

Install MySQL in Ubuntu 14.04

MySQL authoritative guide (original book version 2nd) Clear Chinese scan PDF

Ubuntu 14.04 LTS install LNMP Nginx \ PHP5 (PHP-FPM) \ MySQL

Build a MySQL Master/Slave server in Ubuntu 14.04

Build a highly available distributed MySQL cluster using Ubuntu 12.04 LTS

Install MySQL5.6 and Python-MySQLdb in the source code of Ubuntu 12.04

-------------------------------------- Split line --------------------------------------

This article permanently updates the link address:

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.