Q&A
###前提・実現したいこと
myaql はカラム、テーブルに日本語は使えますか?
テーブルを作ろうとしたときにエラーが出ました。
そもそも不可能なのか、設定次第でどうにかなるのか知りたいです。
###発生している問題・エラーメッセージ
エラーメッセージ
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 ''日付' date,
'費目' int,
'メモ'  varchar(100),
'入金' at line 2
経過時間: 0 時間, 0 分, 0 秒, 0 ミリ秒。
###該当のソースコード
sql
1create table kakeibo( 2 '日付' date, 3 '費目' int, 4 'メモ' varchar(100), 5 '入金額' int, 6 '出金額' int 7); 8 9create table kakeibo( 10 日付 date, 11 費目 int, 12 メモ varchar(100), 13 入金額 int, 14 出金額 int 15);
###試したこと
mysql -u root -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 68
Server version: 5.1.37-community MySQL Community Server (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show variables like "chara%";
+--------------------------+--------------------------+
| Variable_name | Value |
+--------------------------+--------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | C:\MySQL\share\charsets\ |
+--------------------------+--------------------------+
8 rows in set (0.00 sec)
試しにこれは成功しました
sql
1CREATE TABLE book 2( 3id INT(11), 4category_id INT(11), 5title VARCHAR(64), 6author_name VARCHAR(32), 7detail TEXT, 8price INT(11), 9image VARCHAR(64) 10);
###補足情報(言語/FW/ツール等のバージョンなど)
version MySql_5.1
回答4件
あなたの回答
tips
プレビュー
下記のような回答は推奨されていません。
このような回答には修正を依頼しましょう。