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!