Chinaunix首页 | 论坛 | 博客
  • 博客访问: 49104
  • 博文数量: 21
  • 博客积分: 970
  • 博客等级: 准尉
  • 技术积分: 250
  • 用 户 组: 普通用户
  • 注册时间: 2010-01-03 18:43
文章分类
文章存档

2010年(21)

我的朋友

分类: Mysql/postgreSQL

2010-01-22 14:51:45

我的系统是ubuntu9.10,最近新装好的mysql在进入mysql工具时,总是有错误提示:
# mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
解决方法:
# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit

# /etc/init.d/mysql restart
# mysql -uroot -p
Enter password: <输入新设的密码newpassword>

mysql>

另一个问题:
#mysql -u root -p
 
ERROR 2002 (HY000):Can't connect to local MySQL server
 解决方法:
 
先查看 /etc/rc.d/init.d/mysqld status 看看m y s q l 是否已经启动.
另外看看是不是权限问题.
------------------------------------------------------------------------------------
[root@localhost beinan]#chown -R mysql:mysql /var/lib/mysql
[root@localhost beinan]# /etc/init.d/mysqld start
启动 MySQL: [ 确定 ]
[root@localhost lib]# mysqladmin -uroot password '123456'
[root@localhost lib]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.1.11

Type 'help;' or '\h' for help. Type '\c' to clear the buffe
 

 

阅读(547) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~