|
Ubuntu804上自带的MySQL,执行了mysql_install_db,我自己的表也已经创建完毕
本地访问可以:
root@ubuntu804:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.0.51a-3ubuntu5.4 (Ubuntu)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
设置了远程访问权限:
mysql> grant all PRIVILEGES on nw.* to root@'%' identified by 'root';
Query OK, 0 rows affected (0.04 sec)
查看数据库:
mysql> use nw
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+-----------------+
| Tables_in_nw |
+-----------------+
| t_activity_host |
| t_origin_log |
+-----------------+
2 rows in set (0.00 sec)
mysql> select * from t_origin_log;
Empty set (0.00 sec)
可以看到表已经创建成功了,但还没有记录。
root@ubuntu804:~# netstat -an |grep 3306
tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN
本地端口也在监听
root@ubuntu804:~# ufw status
Firewall not loaded
本地防火墙未打开
本地telnet连接3306也可以连接
但是
root@ubuntu804:~# /usr/bin/mysqladmin -u root password 'root'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
并且远程访问一律失败,远程telnet3306也无法连接
C:\>telnet 192.168.14.199 3306
正在连接到192.168.14.199...不能打开到主机的连接, 在端口 3306: 连接失败
root@ubuntu804:~# /usr/bin/mysqladmin -u root password 'root'
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
请问谁知道这是咋回事啊 |
|