Home > Database > Mysql Tutorial > centos解决mysql连接错误ERROR 1045(28000)_MySQL

centos解决mysql连接错误ERROR 1045(28000)_MySQL

WBOY
Release: 2016-06-01 13:48:07
Original
1386 people have browsed it

CentOS

bitsCN.com
centos解决mysql连接错误ERROR 1045(28000) 首先停掉mysql的服务     # service mysql stop 接下来执行    # mysqld_safe --user=mysql --skip-grant-tables --skip-networking & 但是如果没有配置环境变量,系统提示找不到mysqld_safe命令,那么只能找到mysql的安装目录,然后进到bin目录,该命令在当前目录下,所以在当前目录下执行该命令 接下来执行    # mysql -u root mysql   密码为空,登陆到mysql 接下来修改root密码    mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root' and host='root' or host='localhost'; 接下来把空的用户密码都修改成非空的密码    mysql> FLUSH PRIVILEGES;   退出mysql。    mysql> quit 重启mysql服务    # service mysql restart 用新密码登陆到mysql    # mysql -uroot -p Enter password: bitsCN.com
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template