MYSQL教程mysql误删root用户恢复方法

MYSQL教程mysql误删root用户恢复方法,第1张

概述介绍《MYSQL教程mysql误删root用户恢复方法》开发教程,希望对您有用。

《MysqL教程MysqL误删root用户恢复方法》要点:
本文介绍了MysqL教程MysqL误删root用户恢复方法,希望对您有用。如果有疑问,可以联系我们。

MysqL教程装完数据库清理一些默认账号的时候不小心把root删除了,flush privileges 之后的新 root 忘了grant任何权限,查看MysqLd选项里面有个 −−skip-grant-tables

代码如下:
#/usr/libexec/MysqLd --verbos --help

MysqL教程MysqL5.5手册说明如下

代码如下:
--skip-grant-tables

MysqL教程This option causes the server to start without using the privilege system at all,which gives anyone with access to the server unrestricted access to all databases. You can cause a running server to start using the grant tables again by executing MysqLadmin flush-privileges or MysqLadmin reload command from a system shell,or by issuing a MysqL FLUSH PRIVILEGES statement after connecting to the server. This option also suppresses loading of plugins,user-defined functions (UDFs),and scheduled events. To cause plugins to be loaded anyway,use the --plugin-load option.

MysqL教程--skip-grant-tables is unavailable if MysqL was configured with the --disable-grant-options option. See Section 2.10.2,“Typical configure Options”.

MysqL教程MysqLd_safe是Unix/linux系统下的MysqL服务器的一个启动脚本.这个脚本增加了一些平安特性,会在启动MysqL服务器以后继续监控其运行情况,并在出现错误的时候重新启动服务器.后台启动MysqL

代码如下:
#MysqLd_safe --skip-grant-tables &

MysqL教程如果没有root账户就添加一个

代码如下:
INSERT INTO user SET User='root',Host='localhost',ssl_cipher='',x509_issuer='',x509_subject='';

MysqL教程直接输入MysqL连接并添加权限,这时候是不能使用grant命令的,只能用update

代码如下:
UPDATE user SET Select_priv='Y',Insert_priv='Y',Update_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',Alter_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',authentication_string='' WHERE User='root';

MysqL教程注意我用的是MysqL是5.5版本,可能 *** 作过程中SQL语句或其他地方有不同,语句执行完毕之后必要flush privileges,还可能要重新登录才行.

内存溢出PHP培训学院每天发布《MysqL教程MysqL误删root用户恢复方法》等实战技能,PHP、MysqL、liNUX、APP、Js,CSS全面培养人才。

总结

以上是内存溢出为你收集整理的MYSQL教程mysql误删root用户恢复方法全部内容,希望文章能够帮你解决MYSQL教程mysql误删root用户恢复方法所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/1155781.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-01
下一篇 2022-06-01

发表评论

登录后才能评论

评论列表(0条)

保存