I tried to add a table to a database in MySQL using the command line:
mysql -u Jon -p testdb --password=password < "C:\Users\Jon\Documents\Summer\Do\SQL\root.sql"
However, I get an error message when entering above:
ERROR 1064 (42000) at line 12: 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 'VARCHAR(255) DEFAULT NULL, Clearing VARCHAR(255) DEFAULT NULL, Globex VARCH' at line 2
I used dbForge to create a sql file called root.sql :
SET NAMES 'utf8'; USE testdb; DROP TABLE IF EXISTS roottable; CREATE TABLE roottable ( ProductName VARCHAR(255) DEFAULT NULL, Clearing VARCHAR(255) DEFAULT NULL, Globex VARCHAR(255) DEFAULT NULL, IsActive VARCHAR(255) DEFAULT NULL, FloorId VARCHAR(255) DEFAULT NULL, GroupId VARCHAR(255) DEFAULT NULL, SubGroup VARCHAR(255) DEFAULT NULL, ConversionFactor VARCHAR(255) DEFAULT NULL, Id INT PRIMARY KEY AUTO_INCREMENT ) ENGINE = INNODB CHARACTER SET utf8 COLLATE utf8_general_ci;
source share