系统:Centos release 6.5 (Final)内核:2.6.32-431.el6.x86_64Mysql版本:5.5.28-log Source distribution操作步骤:1.停止mys
系统:
Centos release 6.5 (Final)
内核:
2.6.32-431.el6.x86_64
Mysql版本:
5.5.28-log Source distribution
操作步骤:
1.停止mysql服务
#service mysqld stop
2.以安全模式进入mysql
#mysqld_safe --skip-grant-tables &
#mysql -u root -p \此时密码为空
3.重建root
mysql>USE mysql;
mysql>INSERT INTO user(host,user,passWord)
->VALUES('localhost','root',password('password')); \此处的密码可以后期设置
4.给root用户赋权限
update user set Host='localhost',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',event_priv='y',trigger_priv='y',create_tablespace_priv='y' where user='root';
--结束END--
本文标题: mysql误删root后如何恢复root账户
本文链接: https://www.lsjlt.com/news/39527.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
下载Word文档到电脑,方便收藏和打印~
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
2024-05-15
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0