Home > Database > Mysql Tutorial > body text

MySQL登录问题_MySQL

WBOY
Release: 2016-06-01 12:59:50
Original
916 people have browsed it

1、问题一:使用update mysql.user set password='root'修改密码后,不能登录

解决:操作步骤如下。

(1)关闭mysql(杀掉mysqld进程),然后使用命令:

mysqld --skip-grant-tables

(2)启动数据库,就可以正常连接了

(3)接着清除root密码:

update mysql.user set password=null

(4)使用命令mysqld启动数据库

做完这些后就可以正常登录了。

2、问题二:MySQL Error 1130 Host 'localhost' is not allowed to connect to this MySQL server

解决:使用授权语句授权

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;
给root授权本地访问。

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!