Preface This article explains how to create a database name with special characters in MySQL. The special characters here include: !@#$%^ Here’s how Use backticks ` to enclose the database name (quotation marks are not allowed). In the English input method state, press the Esc key to display the corresponding key below. Of course, if you do not use backticks to enclose the database name, an error will be reported if the database name contains special characters. For example, using the following create command will result in an error: mysql> CREATE DATABASE www.mafutian.net DEFAULT CHARSET UTF8; 1064 - Change the syntax of '.mafutian.net DEFAULT CHARSET UTF8' to the string 1 The correct way to create it: mysql> CREATE DATABASE `www.mafutian.net` DEFAULT CHARSET UTF8; Query OK, 1 row affected As shown below: Another example: mysql> CREATE DATABASE `!@#$%^&*()_+.` DEFAULT CHARSET UTF8; Query OK, 1 row affected mysql> USE !@#$%^&*()_+. -> ; 1064 - I have read the syntax of '!@#$%^&*()_+.' to the letter 1 mysql> USE `!@#$%^&*()_+.`; Database changed mysql> SELECT database(); +---------------+ | database() | +---------------+ | !@#$%^&*()_+. | +---------------+ 1 row in set As can be seen from the above, when selecting a database, you also need to use backticks ` to quote the database name. As shown below: Similarly, when deleting a database, you also need to use backticks to quote the database name: mysql> DROP DATABASE `www.mafutian.net`; Query OK, 0 rows affected mysql> DROP DATABASE `!@#$%^&*()_+.`; Query OK, 0 rows affected Summarize The above is the full content of this article. I hope that the content of this article can bring some help to your study or work. If you have any questions, you can leave a message to communicate. Thank you for your support of 123WORDPRESS.COM. You may also be interested in:
|
<<: JavaScript jigsaw puzzle game
>>: A brief analysis of Docker private image library and Alibaba Cloud object storage OSS
1. Target environment Windows 7 64-bit 2. Materia...
Table of contents 1. Numeric Type 1.1 Classificat...
You might be wondering why you should use the pat...
This article uses an example to describe how to c...
The Nginx ngx_http_image_filter_module module (ng...
Table of contents The role of cloneElement Usage ...
Effect (source code at the end): accomplish: 1. D...
I have learned some basic selectors of CSS before...
My mysql version is MYSQL V5.7.9, please use the ...
1 Stored Procedure 1.1 What is a stored procedure...
Recently, I want to build a hadoop test cluster i...
This article records the installation and configu...
1.1 What is MySQL multi-instance? Simply put, MyS...
Add multiple lines to the specified file in Docke...
Preface There are many open source monitoring too...