Home > Database > Mysql Tutorial > body text

Introduction to the method of displaying double quotes in Mysql table creation statement

不言
Release: 2018-12-15 10:49:44
forward
2918 people have browsed it

This article brings you an introduction to the method of displaying double quotes in Mysql table creation statements. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.

I am using Mysql database at work and found that the ddl after creating the table shows that the table name and fields are all in double quotes. Such ddl cannot be passed through the online work order system, and the double quotes need to be converted into back quotes (`).

It is found by executing the command show VARIABLES like '%sql%' that the value of sql_mode is ANSI_QUOTES.

Check the my.cnf configuration file and find the following configuration:

# 对本地的mysql客户端的配置
[client]
#default-character-set = utf8
# 对其他远程连接的mysql客户端的配置
[mysql]
default-character-set = utf8
# 本地mysql服务的配置

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
character-set-server = utf8
sql_mode='ANSI_QUOTES'
default-storage-engine=INNODB

server-id=1
log-bin=mysql-bin
binlog_format=MIXED
expire_logs_days=30

[mysqld_safe]
log-error=/var/log/mysqld.log
Copy after login

Remove the sql_mode configuration under mysqld and restart the service.

The above is the detailed content of Introduction to the method of displaying double quotes in Mysql table creation statement. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:segmentfault.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template