ERROR 1045 (28000): Access denied for user 'root&
在centos下,新搭建的mysql环境,直接输入mysql命令,提示如下错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) 老师说是权限问题,随后在网上找到解决方法,粘贴在此,以备后用 --------------------------------
在centos下,新搭建的mysql环境,直接输入mysql命令,提示如下错误
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
老师说是权限问题,随后在网上找到解决方法,粘贴在此,以备后用
---------------------------------------------------------------------------------------------------------------------------------------------
mysql -uroot -p
输入设置的密码
竟然报错了!
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YSE)
初始密码是空的,可我设置了密码的阿。
密码留空
还是错误!
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/mysqld restart
# mysql -u root -p
Enter password:
mysql>
搞定!
-----------------------------------------------------------------------------------------------------------------------------------------------
推荐阅读
-
ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)
-
MYSQL ERROR 1045 (28000): Access denied for user (using password: YES)问题的解决
-
ERROR 1045: Access denied for user: root@localhost (Using password: NO)
-
新装MySql后登录出现root帐号提示mysql ERROR 1045 (28000): Access denied for use的解决办法
-
解决mysql ERROR 1045 (28000)-- Access denied for user问题
-
ERROR 1045 (28000): Access denied for user ''root''@''localhost'' (using passwor
-
ERROR 1045 (28000): Access denied for user ''root''@''localhost'' (using passwor
-
java访问数据库被拒绝,不能连接数据库ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
-
ERROR 1045 (28000): Access denied for user ''root''@''localhost'' (using password: YES)实用解决方案
-
ERROR 1045 (28000): Access denied for user root@localhost (using password: NO)