centOS下mysql-ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

系统centOS-6.3

方法操作很简单,如下:

# /etc/init.d/mysql stop

# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

# mysql -u root mysql

# mysql>use mysql ;

mysql> UPDATE user SET Password=PASSWORD(‘newpassword‘) where USER=‘root‘ and host=‘root‘ or host=‘localhost‘;//把空的用户密码都修改成非空的密码就行了。

mysql> FLUSH PRIVILEGES;

mysql> quit # /etc/init.d/mysqld restart

# mysql -uroot -p

Enter password: <输入新设的密码newpassword>

这样问题就解决了!

centOS下mysql-ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)

时间: 2024-09-30 00:55:57

centOS下mysql-ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)的相关文章

Mac下解决mysql ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: YES)

Maybe updating the package the updater overwrote the root password. To restore it: Stop mysqld deamons. $ sudo service mysqld stop Go to mysql/bin directory $ cd /usr/bin Start a mysql deamon with this option: $ sudo mysqld_safe --skip-grant-tables O

MYSQL: ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: YES)

1) /etc/init.d/mysqld stop 2) mysqld_safe --skip-grant-tables & 3) mysql -u root 4) Setup new MySQL root user passworduse mysql;#update user set password=PASSWORD("123456") where User='root';#update mysql.user set password=PASSWORD("123

Mysql ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39;(using password: YSE)

安装mysql后,使用命令登录mysql居然报错了,Mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost'(using password: YSE),这个错误搞得很郁闷,仔细分析之后,知道这个报错和密码有关,可能是密码在配置mysql的时候异常,所以导致我们没有正确的密码,知道问题后,立即想到解决办法了,那就是重新设置一个密码,方法如下 1.先关闭mysql并设置密码 #sudo /etc/init.d/mysql

MySQL ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: NO

MySQL安装完server端和客户端后,登录Mysql时报错:[[email protected] MySQL 5.6.23-RMP]# mysqlERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)[[email protected] MySQL 5.6.23-RMP]# service mysql startStarting MySQL.[

Linux mysql 5.6: ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: NO)

最近操作mysql 5.6, 出现了以下问题. 分享,感谢原著: 案例环境: 操作系统 :Red Hat Enterprise Linux Server release 5.7 (Tikanga) 64 bit 数据库版本 : Mysql 5.6.19 64 bit 案例介绍: 今 天开始学习mysql,遂先安装了Mysql 5.6.19 64bit 版本的数据库,结果安装成功了,但是使用root登录时遇到了ERROR 1045 (28000): Access denied for user '

Linux mysql 5.7: ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: NO)

环境:mac10.12 来源:http://www.cnblogs.com/kerrycode/p/3861719.html 使用root登录时遇到了ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)错误. 如下所示 [[email protected] tmp]# rpm -ivh MySQL-server-5.6.19-1.rhel5.x86_64.rpm Preparing..

ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: NO)

在安装好的MySQL服务器上,配置了环境变量之后,发现用mysql无法登录,报如题的错误,实在没有办法,决定用安全模式对root用户修改密码: 首先在一个ssh窗口运行命令:mysqld_safe --user=mysql --skip-grant-tables --skip-networking& [[email protected] ~]# mysqld_safe --user=mysql --skip-grant-tables --skip-networking& 运行之后新打开一个

Mysql 命令行启动问题ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: NO)

Centos 刚装了mysql yum install mysql 安装成功了,安装最后要求输入了密码,也输入了,OK mysql -uroot -p 输入设置的密码 竟然报错了! ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YSE) 问朋友,他说初始密码是空的,可我命名设置了密码的阿. 密码留空 还是错误! ERROR 1045 (28000): Access denied for

转-解决Mysql ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39;问题

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) Red Hat Enterprise Linux 5服务器上mysql启动报错:ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)原因1-启动命令错误:我开始的时候直接输入命令:mysql start 正确的启动命令是:

mac系统中搭建apache+mysql+php的开发环境,安装mysql后,登录报错:mac ERROR 1045 (28000): Access denied for user &#39;root&#39;@&#39;localhost&#39; (using password: NO)

php新手在mac系统中搭建apache+mysql+php的开发环境(按照这篇博客来操作的:http://my.oschina.net/joanfen/blog/171109?fromerr=xvCsafCe),在安装配置mysql完毕后,登录mysql,报错:mac ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO),折腾很久,终于解决,随手记录下,备忘. 解决方法: 第一步:如