Skip to content

Instantly share code, notes, and snippets.

@YumaInaura
Last active December 18, 2015 02:53
Show Gist options
  • Select an option

  • Save YumaInaura/f71c059e563d4bbdd64e to your computer and use it in GitHub Desktop.

Select an option

Save YumaInaura/f71c059e563d4bbdd64e to your computer and use it in GitHub Desktop.
MySQL | 英数字以外とアンダーバー 以外をデータベース名 / テーブル名に使う時はバッククォートで囲う ref: http://qiita.com/Yinaura/items/823c12fc1fd36bd18b63
mysql> CREATE DATABASE e-x-a-m-p-l-e;
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 '-x-a-m-p-l-e' at line 1
mysql> CREATE DATABASE `e-x-a-m-p-l-e`;
Query OK, 1 row affected (0.01 sec)
CREATE DATABASE `e x a m p l e`;
CREATE DATABASE `e/x/a/m/p/l/e`;
CREATE DATABASE `e*x*a*m*p*l*e`;
CREATE DATABASE `えぐざんぷる`;
CREATE DATABASE ` e x a m p l e `;
ERROR 1102 (42000): Incorrect database name ' e x a m p l e '
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment