mysql问题
我的系统是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:
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 是否已经启动.
另外看看是不是权限问题.
------------------------------------------------------------------------------------
#chown -R mysql:mysql /var/lib/mysql
# /etc/init.d/mysqld start
启动 MySQL: [ 确定 ]
# mysqladmin -uroot password '123456'
# 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
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u3/109513/showart_2157762.html
页:
[1]