Home >Database >Mysql Tutorial >解决系统默认的MySQL用户名消失的方法_MySQL

解决系统默认的MySQL用户名消失的方法_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:59:54872browse

修改MySQL下的默认mysql数据库的user表,删除所有host为localhost记录,另外添加一些其他记录,重新启动MySQL服务器。执行show databases,只出现information_schema和test两个数据库,看不到mysql。

解决方法:

此问题实际上是用户没有权限:

1. 关闭mysql

2. 启动mysql: mysqld_safe --skip-grant-tables

在数据库名mysql下的user表中,修改相应权限,比如:

INSERT INTO `user` VALUES ('localhost','root','','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','Y','','','','',0,0,0,0);

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