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
introduction During the front-end project develop...
Types of joins 1. Inner join: The fields in the t...
For work needs, I need to make a mobile phone adap...
The specific code for sending emoticons in the vu...
This article describes how to install MySQL 5.7 f...
Modify /etc/my.cnf or /etc/mysql/my.cnf file [cli...
In MySQL, you may encounter the problem of case s...
Preface I had previously enabled Docker's 237...
1. Enable remote access to the docker server Log ...
1. What is phantom reading? In a transaction, aft...
Vue components are connected, so it is inevitable...
introduction Sometimes, if there are a large numb...
HTML5 adds more semantic tags, such as header, fo...
Before reading this article, I hope you have a pr...
There are two ways to deploy Angular projects wit...