對應(yīng)c7任務(wù)3
創(chuàng)建新用戶‘vsearch’并授權(quán)訪問數(shù)據(jù)庫的權(quán)限出現(xiàn)該問題:
mysql> grant all on vsearchlogDB.* to 'vsearch' identified by 'vsearchpasswd';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'identified by 'vsearchpasswd'' at line 1
解決方法:
先查看是否已經(jīng)創(chuàng)建‘vsearch’新用戶
mysql> SELECT host,user,Grant_priv,Super_priv From mysql.user;
沒有余赢,創(chuàng)建vsearch镐躲。使用書上提供的‘vsearchpasswd’口令析恢,也就是后面vsearch的密碼棵譬。
mysql> create user 'vsearch'@'localhost' identified by 'vsearchpasswd';
再次檢查是否創(chuàng)建成功林艘,vsearch已存在鞭光,但是右邊的權(quán)限均為N氧敢。
將其改為y即可
done