溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

MySQL client執(zhí)行過程

發(fā)布時間:2020-07-19 01:26:02 來源:網(wǎng)絡(luò) 閱讀:396 作者:浮生鳳年 欄目:MySQL數(shù)據(jù)庫

由以下示例得出,客戶端連接MySQL時執(zhí)行語句包括如下過程:
1.認(rèn)證
是否可以登錄MySQL服務(wù)端。
2.語法分析
判斷執(zhí)行語句是否合法,無語句錯誤。
3.權(quán)限分析
判斷執(zhí)行語句,是否有對目標(biāo)的相關(guān)權(quán)限。
4.語義分析
判斷是否存在相應(yīng)的表和字段
5.優(yōu)化執(zhí)行
優(yōu)化器優(yōu)化SQL語句后,執(zhí)行并返回結(jié)果。

1)mysql -utest -h227.0.0.1 -p -P3306 -perror
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'test'@'127.0.0.1' (using password: YES)

mysql> show grants;
+--------------------------------------------------------------------------+
| Grants for test@127.0.0.1                                                |
+--------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'test'@'127.0.0.1' IDENTIFIED BY PASSWORD <secret> |
| GRANT SELECT ON `test`.* TO 'test'@'127.0.0.1'                           |
+--------------------------------------------------------------------------+
2 rows in set (0.00 sec)
mysql> 
mysql> 
2)
mysql> select *** from test.t;
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 '** from test.t' at line 1
mysql> 
3)
mysql> select * from a.t;
ERROR 1142 (42000): SELECT command denied to user 'test'@'127.0.0.1' for table 't'
mysql> 
mysql> 
4)
mysql> select * from test.t;
ERROR 1146 (42S02): Table 'test.t' doesn't exist
mysql> 
mysql> 
向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI