亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

Chinaunix

標(biāo)題: 用具有全部權(quán)限的非root用戶創(chuàng)建其他用戶出現(xiàn)問題 [打印本頁(yè)]

作者: joeguan2    時(shí)間: 2011-04-13 14:19
標(biāo)題: 用具有全部權(quán)限的非root用戶創(chuàng)建其他用戶出現(xiàn)問題
本帖最后由 joeguan2 于 2011-04-15 08:27 編輯

平臺(tái):windows xp,
mysql 版本:mysql 5.5.11

用root創(chuàng)建michael帳戶,michael具有全部權(quán)限
c:\>mysql -hlocalhost -uroot -p
mysql>grant all privileges on *.* to 'michael'@'localhost' identified by 'passwd';

再用michael創(chuàng)建bill就不行了,
c:\>mysql -hlocalhost -umichael -p
mysql>grant all privileges on *.* to 'bill'@'localhost' identified by 'passwd';
結(jié)果錯(cuò)誤:ERROR 1045 (28000): Access denied for user 'michael'@'localhost' (using password: YES)
這是為什么呢?
還是只能用root賬戶創(chuàng)建用戶?
謝謝

*** 上述紅色字體為筆誤更正 ***
作者: andrefun    時(shí)間: 2011-04-13 18:45
with grant;
作者: joeguan2    時(shí)間: 2011-04-13 19:23
with grant;
andrefun 發(fā)表于 2011-04-13 18:45

原聞詳解。
上面的方法有問題嗎?
謝謝
作者: horizonhyg    時(shí)間: 2011-04-14 10:26
回復(fù) 3# joeguan2


   
mysql> GRANT <privileges> ON <what>
-> TO <user> [IDENTIFIED BY "<password>"]
-> [WITH GRANT OPTION];
這個(gè)命令中可選的WITH GRANT OPTION部分指定了用戶可以使用GRANT/REVOKE命令將他擁有的權(quán)限賦予其他用戶。請(qǐng)小心使用這項(xiàng)功能--雖然這個(gè)問題可能不是那么明顯!例如,兩個(gè)都擁有這個(gè)功能的用戶可能會(huì)相互共享他們的權(quán)限,這也許不是你當(dāng)初想看到的。


    好好看看數(shù)據(jù)庫(kù)基本知識(shí)吧
作者: realmon    時(shí)間: 2011-04-14 13:48
ERROR 1045 (28000): Access denied for user 'joe'@'localhost' (using password: YES)

你用joe操作的?
作者: ruochen    時(shí)間: 2011-04-14 16:45
grant all privileges on *.* to 'michael'@'localhost' identified by 'passwd' with grant option;
作者: ruochen    時(shí)間: 2011-04-14 16:46
ERROR 1045 (28000): Access denied for user 'joe'@'localhost' (using password: YES)

你用joe操作的?
realmon 發(fā)表于 2011-04-14 13:48



    估計(jì)user表中有很多%和空user的
作者: joeguan2    時(shí)間: 2011-04-15 08:36
原來是加上with grant option起了作用,謝謝版主及各位的耐心教導(dǎo)




歡迎光臨 Chinaunix (http://www.72891.cn/) Powered by Discuz! X3.2