Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我明白以下内容授予所有名称以'xian_'开头的数据库的所有证明,但mysql抱怨语法错误near ''xian_......
near ''xian_
GRANT ALL PRIVILEGES ON 'xian_%.*' TO xian@'192.168.1.%';
什么是正确的语法?我是否认为_需要\_也逃逸,因为它也是通配符?
_
\_
在数据库名称中使用`代替,并转义'_
`
'
GRANT ALL PRIVILEGES ON `xian\_%`.* TO xian@'192.168.1.%';