新手求助-MySQL 升级的问题
时间:2009-09-03
来源:互联网
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)'
请问谁知道这是咋回事啊
本地访问可以:
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)'
请问谁知道这是咋回事啊
作者: 0xff 发布时间: 2009-09-03
格式是
mysql -u root -p
mysql -u root -p
作者: 木泥黑 发布时间: 2009-09-03
执行了,什么效果都没有,执行后debian.cnf内容不变,
远程还是连不上.
远程还是连不上.
作者: 0xff 发布时间: 2009-09-03
SELECT Host, User FROM mysql.user
查看root用户是否具有远程访问权限,mysql默认是不具有的
查看root用户是否具有远程访问权限,mysql默认是不具有的
作者: davidchenbin 发布时间: 2009-09-17
我也是上午才搞通的
首先
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 一下就连上了。
作者: liyankx 发布时间: 2009-09-18
按楼上的OK,谢谢!
作者: xuehuihe.java 发布时间: 2010-07-21
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28