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
Table of contents What is MVCC MVCC Implementatio...
1. To optimize the query, try to avoid full table...
Sometimes you need to use links, but you don't...
1. Using it with redis will cause Netty startup c...
Online shopping mall database-product category da...
1: What is openssl? What is its function? What is...
Table of contents Preface Idea startup speed Tomc...
Table of contents Virtual DOM What is virtual dom...
Table of contents introduce Object attributes in ...
1. Test environment name Version centos 7.6 docke...
In requireJS, there is a property called baseURL....
Border Style The border-style property specifies ...
Introduction: When using MySQL to create a table,...
The main contents of this article are as follows:...
Table of contents - Preface - - JVM Class Loader ...