- 工信部備案號 滇ICP備05000110號-1
- 滇公安備案 滇53010302000111
- 增值電信業(yè)務(wù)經(jīng)營許可證 B1.B2-20181647、滇B1.B2-20190004
- 云南互聯(lián)網(wǎng)協(xié)會理事單位
- 安全聯(lián)盟認(rèn)證網(wǎng)站身份V標(biāo)記
- 域名注冊服務(wù)機構(gòu)許可:滇D3-20230001
- 代理域名注冊服務(wù)機構(gòu):新網(wǎng)數(shù)碼
mysql數(shù)據(jù)庫的root賬號被誤刪除了如何添加
1.打開mysql.ini文件在mysqld下面添加skip-grant-tables后重啟mysql數(shù)據(jù)庫.
2. 直接執(zhí)行mysql命令進(jìn)入數(shù)據(jù)庫
MariaDB [mysql]> insert into mysql.user set user='root'; 插入一個賬號(執(zhí)行下面命令,設(shè)置root用戶的權(quán)限,所有權(quán)限為 ' y ' ,即擁有最高權(quán)限。)
MariaDB [mysql]> 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' where user='root';
4.退出后重啟mysql數(shù)據(jù)庫執(zhí)行mysql –uroot –p 直接回車進(jìn)入數(shù)據(jù)庫設(shè)置root密碼
MariaDB [(none)]> update mysql.user set password=password('1234567') where user=
'root';
MariaDB [(none)]> flush privileges;
MariaDB [(none)]> exit
5.去掉my.ini中的skip-grant-tables后重啟數(shù)據(jù)庫就可以使root賬號進(jìn)入mysql數(shù)據(jù)庫了
售前咨詢
售后咨詢
備案咨詢
二維碼
TOP