Home > Database > Mysql Tutorial > ROOT账户误删后恢复指南

ROOT账户误删后恢复指南

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 14:57:45
Original
1180 people have browsed it

无详细内容 无 --1 杀掉你的MYSQLD进程/etc/init.d/mysqld stop--2 进入MYSQL的bin目录,以不验证权限的方式启动MYSQLcd /usr/local/mysql/bin./mysqld_safe --skip-grant-tables --3 新起进程登录MYSQL./mysql--4 尽量别用ROOT账户名,创建admin用户insert i

--1 杀掉你的MYSQLD进程
/etc/init.d/mysqld stop

--2 进入MYSQL的bin目录,以不验证权限的方式启动MYSQL
cd /usr/local/mysql/bin
./mysqld_safe --skip-grant-tables &

--3 新起进程登录MYSQL
./mysql

--4 尽量别用ROOT账户名,创建admin用户
insert into mysql.user set user='admin',ssl_cipher='',host='%',password=password("password"), x509_issuer='', x509_subject='';

--5 赋予权限
update mysql.user set Host='%',select_priv='Y', insert_priv='Y',update_priv='Y', Alter_priv='Y',delete_priv='Y',create_priv='Y',drop_priv='Y',reload_priv='Y',shutdown_priv='Y',Process_priv='Y',file_priv='Y',grant_priv='Y',References_priv='Y',index_priv='Y',create_user_priv='Y',show_db_priv='Y',super_priv='Y',create_tmp_table_priv='Y',Lock_tables_priv='Y',execute_priv='Y',repl_slave_priv='Y',repl_client_priv='Y',create_view_priv='Y',show_view_priv='Y',create_routine_priv='Y',alter_routine_priv='Y',create_user_priv='Y' where user='admin';

--6 加载新的权限
flush privileges;

--7 杀掉 safe 模式的mysql进程
killall mysqld

--8 启动MYSQL
/etc/init.d/mysqld start
Copy after login
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