編碼的世界 / 優質文選 / 歷史

Mysql版本8.0和5.7_關鍵字命名的坑


2022年5月23日
-   

Mysql8.0對關鍵字的處理做了進一步嚴格約束,這在Mysql5.7是沒有的,或者約束較少
比如,一個叫 “admin”的表,在Mysql5.7中執行 
select * from admin

是可行的,但是在 Mysql8.0 中執行該語句將會報錯
[SQL] select * from admin
[Err] 1064 - 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 'admin' at line 1

注意一下,盡量將軟件的版本控制在一定範圍,不要使用最新版或者較新版軟件!

熱門文章