【问题标题】:Access denied for user 'root@localhost' (using password: YES)用户“root@localhost”的访问被拒绝(使用密码:是)
【发布时间】:2013-06-11 11:05:25
【问题描述】:

Cent OS中安装MySQL时,安装正确。

安装后,我在终端输入这个命令。

/etc/init.d/mysqld start

它显示错误,我输入密码为 'new-password'。这一次,我发现了这个错误。

[root@datsvr018 bin]# /etc/init.d/mysqld start
Starting mysqld:                                           [  OK  ]

[root@datsvr018 bin]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MySQL to secure it, we'll need the current password
for the root user.  If you've just installed MySQL, and you haven't set
the root password yet, the password will be blank, so you should just press enter here.

Enter current password for root (enter for none): 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

【问题讨论】:

  • 嗨,你有没有设法解决这个问题?我也有同样的问题
  • 不,我不再这样做了。那时,我使用其他操作系统(意味着 windows)进行测试,因为我无法修复它。我在研究时发现了这个问题。如果您找到任何解决方案,请在此发布。我会投票给它。这对其他人会有所帮助。谢谢。

标签: mysql linux installation centos


【解决方案1】:

安装 MySQL 后,需要运行 mysqladmin 设置 root 密码。

mysqladmin -u root password NEWPASSWORD

【讨论】:

  • 我卸载 MySQL 并重新安装。安装完成后,我尝试。错误相同。
猜你喜欢
  • 2013-11-03
  • 2014-09-10
  • 2012-08-08
  • 2013-05-26
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多