syntax error

[expired user #6910]'s profile image [expired user #6910] posted 11 years ago in General Permalink

SQL error(1064):you have an error in your SQL syntax;
check the manual the corresponds to your MySQL server version
for the right syntax to use near 'mysql' at line 1

I am using MySQL v5.1 I would like to get this resolved quickly if possible it is keeping me from getting my game done

-- SQL Database for RMX-OS
-- by Blizzard
START TRANSACTION;

-- these two are used to create the database and can be ommited in case the database already exists
CREATE DATABASE IF NOT EXISTS `rmxosdb` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; USE `rmxosdb`;
DROP TABLE IF EXISTS `save_data`;
DROP TABLE IF EXISTS `inbox`;
DROP TABLE IF EXISTS `buddy_list`;
DROP TABLE IF EXISTS `user_data`;
DROP TABLE IF EXISTS `guilds`;
DROP TABLE IF EXISTS `ips`;
DROP TABLE IF EXISTS `users`;

-- Registered Users
CREATE TABLE `users` (
`user_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`username` VARCHAR(32) NOT NULL UNIQUE,
`password` VARCHAR(11) NOT NULL,
`usergroup` INT(10) NOT NULL DEFAULT 0,
`banned` TINYINT(1) NOT NULL DEFAULT 0, PRIMARY KEY (`user_id`)
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

-- IPs
CREATE TABLE `ips` (
`user_id` INT(10) UNSIGNED NOT NULL,
`ip` VARCHAR(15) NOT NULL, PRIMARY KEY (`user_id`, `ip`), FOREIGN KEY (`user_id`) REFERENCES users(`user_id`) ON
DELETE CASCADE
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

-- Guilds
CREATE TABLE `guilds` (
`guild_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`leader_id` INT(10) UNSIGNED NOT NULL UNIQUE,
`guildname` VARCHAR(32) NOT NULL UNIQUE,
`password` VARCHAR(11) NOT NULL, PRIMARY KEY (`guild_id`), FOREIGN KEY (`leader_id`) REFERENCES users(`user_id`) ON
DELETE CASCADE
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

-- Special User Data
CREATE TABLE `user_data` (
`user_id` INT(10) UNSIGNED NOT NULL,
`notrade` TINYINT(1) NOT NULL DEFAULT 0,
`lastlogin` DATETIME NOT NULL,
`guild_id` INT(10) UNSIGNED DEFAULT NULL, PRIMARY KEY (`user_id`), FOREIGN KEY (`user_id`) REFERENCES users(`user_id`) ON
DELETE CASCADE, FOREIGN KEY (`guild_id`) REFERENCES guilds(`guild_id`) ON
DELETE SET NULL
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

-- Buddy List
CREATE TABLE `buddy_list` (
`user1_id` INT(10) UNSIGNED NOT NULL,
`user2_id` INT(10) UNSIGNED NOT NULL, PRIMARY KEY (`user1_id`, `user2_id`), FOREIGN KEY (`user1_id`) REFERENCES users(`user_id`) ON
DELETE CASCADE, FOREIGN KEY (`user2_id`) REFERENCES users(`user_id`) ON
DELETE CASCADE
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

-- PM Inbox Data
CREATE TABLE `inbox` (
`pm_id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`recipient_id` INT(10) UNSIGNED NOT NULL,
`sendername` VARCHAR(32) NOT NULL,
`senddate` DATETIME NOT NULL,
`message` TEXT NOT NULL,
`unread` TINYINT(1) NOT NULL DEFAULT 1, PRIMARY KEY (`pm_id`), FOREIGN KEY (`recipient_id`) REFERENCES users(`user_id`) ON
DELETE CASCADE
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci;

-- Saved Data
CREATE TABLE `save_data` (
`user_id` INT(10) UNSIGNED NOT NULL,
`data_name` VARCHAR(255) NOT NULL,
`data_value` TEXT NOT NULL, PRIMARY KEY (`user_id`, `data_name`), FOREIGN KEY (`user_id`) REFERENCES users(`user_id`) ON
DELETE CASCADE
) ENGINE = InnoDB DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci; COMMIT;
MySQL

ansgar's profile image ansgar posted 11 years ago Permalink
See the very end of your script, the last command: "MySQL". And read the error message "... for the right syntax to use near 'mysql' at line..."

This is nothing HeidiSQL specific, by the way. I should go and ask Blizard for money as we solve their bugs here.
[expired user #6910]'s profile image [expired user #6910] posted 11 years ago Permalink
well honestly it has nothing to do with blizzard I don't have experience with these things and im asking different places because I don't want to pester one person too much
[expired user #6910]'s profile image [expired user #6910] posted 11 years ago Permalink
well honestly it has nothing to do with blizzard I don't have experience with these things and im asking different places because I don't want to pester one person too much
ansgar's profile image ansgar posted 11 years ago Permalink
Blizzard is stated in your posted SQL script:
-- SQL Database for RMX-OS

-- by Blizzard


Crossposting in different forums is very bad practice. Keep it in one forum, the one which is most responsible for your issues. HeidiSQL is not responsible at all here.

Please login to leave a reply, or register at first.