How Do I Fix MySQL Error #1064?

Avatar
  • Answered
Erreur
Requête SQL:
CREATE USER 'syslogng'@ 'localhost' IDENTIFIED BY 'SyS10g-Ng!';
GRANT USAGE ON * . * TO 'syslogng'@ 'localhost' IDENTIFIED BY 'SyS10g-Ng!'
WITH MAX_QUERIES_PER_HOUR 0
MAX_CONNECTIONS_PER_HOUR 0
MAX_UPDATES_PER_HOUR 0
MAX_USER_CONNECTIONS 0 ;
CREATE DATABASE 'syslogng';
GRANT ALL PRIVILEGES ON `syslogng` . * TO 'syslogng'@ 'localhost';
CREATE TABLE `logs` (
`host` varchar(32) default NULL,
`facility` varchar(10) default NULL,
`priority` varchar(10) default NULL,
`level` varchar(10) default NULL,
`tag` varchar(10) default NULL,
`date` date default NULL,
`time` time default NULL,
`program` varchar(15) default NULL,
`msg` text,
`seq` int(10) unsigned NOT NULL auto_increment,
PRIMARY KEY (`seq`),
KEY `host` (`host`),
KEY `program` (`program`),
KEY `time` (`time`),
KEY `date` (`date`),
KEY `priority` (`priority`),
KEY `facility` (`facility`)
);

MYSQL answer:
#1064 - 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 ''localhost' IDENTIFIED BY 'SyS10g-Ng!'' at line 1
Avatar
johnpaulb-imhs1
Hello kamel, Thank you for contacting us about a MySQL 1064 error. In your 1st line, try removing the blank space after the '@' symbol. I was able to determine this by reviewing the MySQL guide on how toCreate a User syntax. If you have further problems, it may be beneficial to separate your statements into separate parts (instead of performing 1 long task). Thank you, John-Paul B