[root@jl bin]# ./mysql -u root -pmysql
Enter password: sql
Welcome to the MySQL monitor. Commands end with ; or \g..net
Your MySQL connection id is 1ip
Server version: 5.6.12 MySQL Community Server (GPL)get
······it
······io
mysql> SELECT user,host,password FROM mysql.user;class
·······登錄
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.31' IDENTIFIED BY '123456' WITH GRANT OPTION; 密碼
Query OK, 0 rows affected (0.00 sec)
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
#指定客戶機用戶名,ip,密碼登陸