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)'
请问谁知道这是咋回事啊
MySQL远程连接不上!!
- 0xff
- 帖子: 415
- 注册时间: 2008-08-12 14:24
- 联系:
- 木泥黑
- 帖子: 1339
- 注册时间: 2008-10-18 12:41
- 0xff
- 帖子: 415
- 注册时间: 2008-08-12 14:24
- 联系:
Re: MySQL远程连接不上!!
执行了,什么效果都没有,执行后debian.cnf内容不变,
远程还是连不上.
远程还是连不上.
-
- 帖子: 62
- 注册时间: 2008-08-22 20:04
Re: MySQL远程连接不上!!
SELECT Host, User FROM mysql.user
查看root用户是否具有远程访问权限,mysql默认是不具有的
查看root用户是否具有远程访问权限,mysql默认是不具有的
-
- 帖子: 48
- 注册时间: 2008-07-25 7:40
Re: MySQL远程连接不上!!
我也是上午才搞通的
首先
mysql>use mysql;
mysql>update user set Host = '%' where User = 'username';
然后
打开 /etc/mysql/my.cnf 文件,找到 bind-address = 127.0.0.1 修改为 bind-address = 0.0.0.0
重启mysql : sudo /etc/init.d/mysql restart
就好了,我在windows XP下用Navicat for mysql 一下就连上了。
首先
mysql>use mysql;
mysql>update user set Host = '%' where User = 'username';
然后
打开 /etc/mysql/my.cnf 文件,找到 bind-address = 127.0.0.1 修改为 bind-address = 0.0.0.0
重启mysql : sudo /etc/init.d/mysql restart
就好了,我在windows XP下用Navicat for mysql 一下就连上了。
-
- 帖子: 1
- 注册时间: 2010-07-14 17:08
Re: MySQL远程连接不上!!
按楼上的OK,谢谢!
-
- 帖子: 26
- 注册时间: 2010-03-15 23:05
Re: MySQL远程连接不上!!
谢谢 5楼啊 弄好了