日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢(xún)
選擇下列產(chǎn)品馬上在線(xiàn)溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
MySQL數(shù)據(jù)庫(kù)用戶(hù)權(quán)限表丟失的解決方案

在安裝軟件時(shí),需要用到Mysql數(shù)據(jù)庫(kù),要在里面建一個(gè)數(shù)據(jù)庫(kù),及相應(yīng)的用戶(hù),執(zhí)行建庫(kù)腳本,很順利,數(shù)據(jù)庫(kù)成功建好,但在執(zhí)行用戶(hù)授權(quán)時(shí)錯(cuò)誤就產(chǎn)生了:

邳州網(wǎng)站建設(shè)公司創(chuàng)新互聯(lián)建站,邳州網(wǎng)站設(shè)計(jì)制作,有大型網(wǎng)站制作公司豐富經(jīng)驗(yàn)。已為邳州數(shù)千家提供企業(yè)網(wǎng)站建設(shè)服務(wù)。企業(yè)網(wǎng)站搭建\外貿(mào)營(yíng)銷(xiāo)網(wǎng)站建設(shè)要多少錢(qián),請(qǐng)找那個(gè)售后服務(wù)好的邳州做網(wǎng)站的公司定做!

 
 
 
  1. createdatabasecactidb;  
  2.  
  3. grantalloncactidb.*toroot@localhost;  
  4.  
  5. grantalloncactidb.*tocactiuser; 

本來(lái)這是沒(méi)什么的,但我之前已經(jīng)把root@localhost這個(gè)用戶(hù)給刪除了,我只留下了用戶(hù)名為root,host是%的用戶(hù),而我平常的操作為了方便都只是用root在本機(jī)登錄的,我的mysql也只監(jiān)聽(tīng)127.0.0.1這個(gè)地址,結(jié)果一執(zhí)行g(shù)rantalloncactidb.*toroot@localhost;這個(gè)命令立即完蛋了,我在本機(jī)用root登錄就只能是root@localhost這個(gè)用戶(hù)的權(quán)限,而不是一平常用的root@%這個(gè)用戶(hù),但root@localhost基本就是沒(méi)有權(quán)限,按照Mysql的授權(quán)機(jī)制,我只有在其它主機(jī)登錄才可使用root@%這個(gè)用戶(hù),而我根本就不可能從其它地址登錄,這下把我給急壞了。由于嚴(yán)格的防火墻策略,我是不可能開(kāi)放mysql的端口的。后來(lái)在網(wǎng)上找了相關(guān)資料,用以下方法解決了這個(gè)問(wèn)題:

1、關(guān)閉mysql服務(wù):servicemysqldstop。

2、./mysqld_safe--skip-grant-tables重新啟動(dòng)mysql。

3、重新使用root登錄,此時(shí)不需要密碼。

4、登錄后刪除root@local這個(gè)用戶(hù)。

5、用ps查到mysqld進(jìn)程,并用kill中止mysql進(jìn)程。

6、重新啟動(dòng)mysql進(jìn)程:servicemysqldstart。

7、當(dāng)然使用這個(gè)方法也可重置root密碼:setpasswordforroot=password(yourpass');

8、或者也可以重置root用戶(hù)權(quán)限。

 
 
 
  1. updatedbsetSelect_priv='Y'whereuser='root';  
  2.  
  3. updatedbsetInsert_priv='Y'whereuser='root';  
  4.  
  5. updatedbsetUpdate_priv='Y'whereuser='root';  
  6.  
  7. updatedbsetDelete_priv='Y'whereuser='root';  
  8.  
  9. updatedbsetCreate_priv='Y'whereuser='root';  
  10.  
  11. updatedbsetDrop_priv='Y'whereuser='root';  
  12.  
  13. updatedbsetReferences_priv='Y'whereuser='root';  
  14.  
  15. updatedbsetGrant_priv='Y'whereuser='root';  
  16.  
  17. updatedbsetIndex_priv='Y'whereuser='root';  
  18.  
  19. updatedbsetAlter_priv='Y'whereuser='root';  
  20.  
  21. updatedbsetCreate_tmp_table_priv='Y'whereuser='root';  
  22.  
  23. updatedbsetLock_tables_priv='Y'whereuser='root';  
  24.  
  25. updatedbsetCreate_view_priv='Y'whereuser='root';  
  26.  
  27. updatedbsetGrant_priv='Y'whereuser='root';  
  28.  
  29. updatedbsetShow_view_priv='Y'whereuser='root';  
  30.  
  31. updatedbsetCreate_routine_priv='Y'whereuser='root';  
  32.  
  33. updatedbsetAlter_routine_priv='Y'whereuser='root';  
  34.  
  35. updatedbsetExecute_priv='Y'whereuser='root'; 

再把mysql.user表里root用戶(hù)的所有字段都置為'Y'。

注意:使用--skip-grant-tables啟動(dòng)mysql時(shí)不可使用grant命令的,所以只有我們手工來(lái)設(shè)置權(quán)限表了。

關(guān)于MySQL權(quán)限表的問(wèn)題就介紹到這里,如果大家想了解更多關(guān)于MySQL數(shù)據(jù)庫(kù)的知識(shí),不妨到這里看一下:http://database./mysql/,一定會(huì)讓您滿(mǎn)意的哦!

【編輯推薦】

  1. 利用mysql的audit審計(jì)功能記錄用戶(hù)操作信息
  2. MySQL索引背后的數(shù)據(jù)結(jié)構(gòu)及算法之索引實(shí)現(xiàn)
  3. Facebook對(duì)MySQL依賴(lài)的后果將是“比死還糟
  4. 詳解Discuz_WIN7_Apache_MySQL_PHP平臺(tái)搭建
  5. MySQL錯(cuò)誤:Can'tconnecttoMySQLserver(10060)

網(wǎng)站題目:MySQL數(shù)據(jù)庫(kù)用戶(hù)權(quán)限表丟失的解決方案
文章位置:http://m.5511xx.com/article/cdjgppc.html