Home >Database >Mysql Tutorial >ERROR 1045 (28000): Access denied for user 'root'@'localhost

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 17:22:483966browse

ERROR 1045 (28000): Access denied for user

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

这个问题也是在Linux下安装mysql数据库时遗留下的问题:

因为在安装mysql之添加了用户: useradd mysql  安装完成后,mysql用户登录mysql数据库不需要密码,而root用户需要登录密码

这次在将joomla放到hotdocs下的时候,恢复数据库:

Mysql

提示如下错误:

它的意思就是说root用户没有密码不能访问。  怎么办? 改密码呗:

1> 进入mysql

Mysql -u root -p

Dell_456

2> 修改密码:

Set password for 'root'@'localhost'=password('')    这里其实就是给它设为空密码

Flush privileges ;

这句话的意思是:在mysql中新设置用户或者更改密码后需要用flush privileges 刷新

mysql的系统权限相关表,否则会出现拒绝访问,还有一种方法是重启mysql服务器

来使设置生效。

linux

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:SqlServer表分区Next article:Oracle