You need to execute that file in MySQL rather than directly in a shell.
Try this, substituting your MySQL username in the obvious place (either the zm user or the root user):
Code: Select all
mysql -u USERNAME -p zm < zm_create.sql
Make sure that the input file contains only the definition for the logs table or else you might wipe out everything else, with no warning. Do not do it with the original file. Best bet is to copy the code you pasted, save it to a new file, and use that.
For general day-to-day SQL management
phpMyAdmin is handy, and you could paste the table definition directly into that
Code: Select all
CREATE TABLE `zm`.`Logs` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`TimeKey` decimal(16,6) NOT NULL,
`Component` varchar(32) NOT NULL,
`ServerId` int(10) unsigned,
`Pid` int(10) DEFAULT NULL,
`Level` tinyint(3) NOT NULL,
`Code` char(3) NOT NULL,
`Message` text NOT NULL,
`File` varchar(255) DEFAULT NULL,
`Line` smallint(5) unsigned DEFAULT NULL,
PRIMARY KEY (`Id`),
KEY `TimeKey` (`TimeKey`)
) ENGINE=InnoDB;
CREATE INDEX `Logs_TimeKey_idx` ON `Logs` (`TimeKey`);
CREATE INDEX `Logs_Level_idx` ON `Logs` (`Level`);