Create MySQL database with hyphen:
If you are trying to create MySQL database with hyphen " - " in the name such as test-db and get error " your MySQL server version for the right syntax to use near '-db' at line"
then you might be wondering how to get it done as your business require MySQL database name with hyphen " - "
Here is the fix, use escape character " ` " before and after database name such as `test-db` and you will be able to create database with hyphen.
CREATE DATABASE `test-db`;
If you are trying to create MySQL database with hyphen " - " in the name such as test-db and get error " your MySQL server version for the right syntax to use near '-db' at line"
then you might be wondering how to get it done as your business require MySQL database name with hyphen " - "
Here is the fix, use escape character " ` " before and after database name such as `test-db` and you will be able to create database with hyphen.
CREATE DATABASE `test-db`;
Comments
Post a Comment