MySQLでテーブルに情報を入れたのですがエラーをはいて進むことができません
お手数ですが助けてください
mysql> #テーブル作成:画像情報テーブル
mysql> create table T_Info(
->
-> User_Level decimal(1) Primary Key,
-> Photo_ID int(20) not null auto_increment,
-> Fav_ID int(20) not null auto_increment,
-> Camera_ID int(1) not null,
-> Photo_Data Mediumblob not null,
-> Photo_Time time not null,
-> Photo_Day data not null,
->
-> foreign key(Fav_ID) references T_Fav(Fav_ID)
-> foreign key(Camera_ID) references T_Camera(Camera_ID)
->
-> );
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 'data not null,
foreign key(Fav_ID) references T_Fav(Fav_ID)
foreign key' at line 9
mysql>
mysql> #テーブル作成:お気に入りテーブル
mysql> create table T_Fav(
->
-> Fav_ID int(20) auto_increment Primary Key ,
-> Fav_Data Mediumblob not null,
->
->
-> );
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 ')' at line 7
新しいエラーが出ました・・・・
mysql> #テーブル作成:画像情報テーブル
mysql> create table T_Info(
->
-> User_Level decimal(1) Primary Key,
-> Photo_ID int(20) not null auto_increment,
-> Fav_ID int(20) not null auto_increment,
-> Camera_ID int(1) not null,
-> Photo_Date Mediumblob not null,
-> Photo_Time time not null,
-> Photo_Day date not null,
->
-> foreign key(Fav_ID) references T_Fav(Fav_ID)
-> foreign key(Camera_ID) references T_Camera(Camera_ID)
->
-> );
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 'foreign key(Camera_ID) references T_Camera(Camera_ID)
)' at line 12
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。