简体   繁体   中英

ERROR 1064 (42000) when creating database in mysql

in mysql interactive terminal, when I want to create a new database

mysql> create database albedo-new;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-new' at line 1

I'm not sure whether mysql allow '-' in a database name.

mysql does allow hyphens in database names

use backticks

create database `albedo-new`

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM