尝试启动MySQL时出错

时间:2018-08-27 07:27:30

标签: mysql database eclipse command-prompt

我已将mysql作为服务安装并正在运行。

enter image description here

但是当我尝试启动mysql时,出现此错误:

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

出什么问题了?我似乎找不到任何相关的解决方案。

任何建议都值得赞赏。谢谢你。

编辑:

enter image description here 这是我的错误截图。

1 个答案:

答案 0 :(得分:1)

Start the MySQL server instance
$ mysqld --skip-grant-tables

Execute these statements.
$ mysql -u root mysql
$mysql> UPDATE user SET Password=PASSWORD('my_password') where USER='root';
$mysql> FLUSH PRIVILEGES;


$ /etc/init.d/mysql restart


$ mysql -u root -p with new password
相关问题