1024programmer Mysql What is the mysql escape character

What is the mysql escape character

The mysql escape character is 【`】, which is used to avoid the column name or table name and the keyword conflict of mysql itself. It is usually used to indicate that the content is the database name, table name, field name, not a keyword .

` is the escape character of MySQL, which is used to avoid the conflict between the column name or table name and the keyword of mysql itself.

All databases have similar settings, but mysql uses `. It is usually used to indicate that the contents are database names, table names, and field names, not keywords. For example:

select * from table_name where `key` = 'key_name';

Among them, the key is mysql keyword, if the column name is a key, it needs to be escaped with ``.

Extension: \ needs to be used in the string to escape `, otherwise an error will be reported indicating a syntax error.

mysql -uUser -pPasswd -e "select * from table_name where \`key\` = 'name';"

More related free learning recommendations: mysql tutorial (video)

The above is the detailed content of mysql escape characters, please pay attention to 1024programmer.com for more related articles!

This article is from the internet and does not represent1024programmerPosition, please indicate the source when reprinting:https://www.1024programmer.com/what-is-the-mysql-escape-character/

author: admin

Previous article
Next article

Leave a Reply

Your email address will not be published. Required fields are marked *

Contact Us

Contact us

181-3619-1160

Online consultation: QQ交谈

E-mail: [email protected]

Working hours: Monday to Friday, 9:00-17:30, holidays off

Follow wechat
Scan wechat and follow us

Scan wechat and follow us

Follow Weibo
Back to top
首页
微信
电话
搜索