连接localhost,空密码,可以连接。
$ mysql -u root -h localhost -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.14-classicType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> quit
Bye
连接机器名sd03,空密码,出现错误。
$ mysql -u root -h sd03 -p
Enter password:
ERROR 2003: Can't connect to MySQL server on 'sd03' (239)
$
$ mysql -u root -h localhost -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.14-classicType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql> quit
Bye
连接机器名sd03,空密码,出现错误。
$ mysql -u root -h sd03 -p
Enter password:
ERROR 2003: Can't connect to MySQL server on 'sd03' (239)
$
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 4.0.14-classicType 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>GRANT ALL PRIVILEGES ON *.* TO root@"%" WITH GRANT OPTION;
Query OK, 0 rows affected (0.04 sec)mysql>