Mysql allows remote login configuration
Mysql-h 10.17.11.187-uroot-ploushang
To enable remote logon, follow these steps:
1. log on to Mysql-Server to connect to local mysql (only local connections are allowed by default)
2. Modify the user configuration of Mysql-Server.
Mysql> USE mysql; -- switch to mysql DB
Database changed
Mysql> SELECT User, Password, Host FROM user; -- view existing users, passwords, and hosts allowed to be connected
+ ------ + ---------- + ----------- +
| User | Password | Host |
+ ------ + ---------- + ----------- +
| Root | localhost |
+ ------ + ---------- + ----------- +
1 row in set (0.00 sec)
Mysql> -- only one default root user. The password is blank and only localhost connection is allowed.
Mysql> -- Next we will add another root user. The password is blank and only 192.168.1.100 connections are allowed.
Mysql> grant all privileges on *. * TO 'root' @ '192. 168.1.100 'identified by' 'with grant option;
Mysql> -- @ '2017. 168.1.100' can be replaced with @ '%' to access any ip address. Of course, we can also directly UPDATE the root user Host with UPDATE, but it is not recommended. The SQL is as follows:
Mysql> -- UPDATE user SET Host = '192. 168.1.100 'WHERE User = 'root' AND Host = 'localhost' LIMIT 1;
Mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
Change root Password
Mysql> use mysql
Database changed
Mysql> update user set password = PASSWORD ('000000') where user = 'root ';
Query OK, 0 rows affected (0.00 sec)
Rows matched: 1 Changed: 0 Warnings: 0
Mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)