[root@centos65 ~]#mysql -uroot -p123456
Warning: Using apassword on the command line interface can be insecure.
Welcome to theMySQL monitor. Commands end with ; or\g.
Your MySQLconnection id is 60
Server version:5.6.37 Source distribution
Copyright (c)2000, 2017, Oracle and/or its affiliates. All rights reserved.
Oracle is aregistered trademark of Oracle Corporation and/or its
affiliates. Othernames may be trademarks of their respective
owners.
Type 'help;' or'\h' for help. Type '\c' to clear the current input statement.
mysql>
注意:将此处的123456换成你的数据库root的真实密码。
添加远程连接用户,并设置其密码(此处按你的需要设置用户名和密码)
mysql> use mysql;
mysql> GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '密码' WITH GRANT OPTION;
Query OK, 0 rowsaffected (0.00 sec)