How many backslashes should be written in different situations in SQL?

A certain piece of SQL needs to parse a json string in a field. However, the Chinese characters in it are also encoded and stored in a similar format.

u6e38u620f

The SQL statement is theoretically as follows

get_json_object(extends,'$.cate')='u6e38u620f'

However, the actual system execution involves layers of compilation processes. How many backslashes should be written to select the correct result?

The experimental conclusions are as follows:

Syntax errors caused by mysql reserved keywords

When executing the original program in a new mysql environment, a syntax error is prompted. After checking, it is found that the mysql version of the environment is mysql8. The word groups has become a reserved keyword since mysql8.0.2. It is temporarily replaced by `groups`. It should still be used in the future. Be careful to avoid this kind of pitfalls.

You have an error in your SQL syntax...

Official documentation: https://dev.mysql.com/doc/refman/8.0/en/keywords.html

Mysql connection database localhost is slower than 127.0.0.1

During the development process of php+mysql, when filling in the host name for connecting to the database, the local machine can generally use localhost or 127.0.0.1. In the actual application process, no abnormalities have been found in the Linux system, but in the Windows server system, there are When writing localhost, the web page response will be relatively slow. Generally, it takes more than 1 second to complete a page. I judged the program running time step by step and found that it was a problem when connecting to mysql. It takes nearly 1 second to establish a connection.

Solve the problem of secure-file-priv option when importing and exporting mysql data

Mysql database imports or exports from a file to a file, prompting The MySQL server is running with the --secure-file-priv option so it cannot execute this statement. The reasons and solutions are as follows:

Some versions of mysql have restrictions on import and export through files, which are not allowed by default.

View the configuration and execute the mysql command

Subscribe to SQL data