xx@ubuntu:~$ mysql -h192.168.247.128 -uroot -p123456
mysql: [Warning] Using a password on the command line interface can be insecure.
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.247.128' (111)
xx@ubuntu:~$
这里得到了mysql数据库的配置文件my.cnf, 再重启mysql服务, 然后 执行 mysql -h192.168.247.128 -uroot -p (ps:主机ip请输入自己的)
并输入数据库用户root的密码即可连接mysql数据库。如下:
xx@ubuntu:/usr/local/mysql$ sudo ./support-files/mysql.server restart
[sudo] password for xx:
Shutting down MySQL
.... *
Starting MySQL
.. *
xx@ubuntu:/usr/local/mysql$ mysql -h192.168.245.128 -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.7.5-m15 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>