1

Тема: #1064 - You have an error in your SQL syntax...

Добрый вечер,  при попытке восстановить таблицу в базе данных выдало:

#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 '(`user_id`),
  UNIQUE KEY `auth_key` (`auth_key`)
) ENGINE=MyISAM DEFAULT CHAR' at line 13

Не могу разобраться......в чем проблема? sad

2

Re: #1064 - You have an error in your SQL syntax...

Какая версия MySQL установлена?

3

Re: #1064 - You have an error in your SQL syntax...

Hanut сказал:

Какая версия MySQL установлена?

MySQL Version: 5.1.58

4

Re: #1064 - You have an error in your SQL syntax...

Ошибки не вижу. Покажите полный запрос на создание таблицы, которая выдает ошибку.

5

Re: #1064 - You have an error in your SQL syntax...

Hanut сказал:

Ошибки не вижу. Покажите полный запрос на создание таблицы, которая выдает ошибку.

SQL-запрос:

#
# Structure for the `phpbb_bt_users` table :
#
CREATE TABLE  `phpbb_bt_users` (

`user_id` MEDIUMINT( 9 ) NOT NULL DEFAULT  '0',
`auth_key` CHAR( 10 ) CHARACTER SET cp1251 COLLATE cp1251_bin NOT NULL DEFAULT  '',
`u_up_total` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT  '0',
`u_down_total` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT  '0',
`u_bonus_total` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT  '0',
`max_up_speed` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT  '0',
`max_down_speed` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT  '0' PRIMARY KEY (  `user_id` ) ,
UNIQUE KEY  `auth_key` (  `auth_key` )
) ENGINE = MYISAM DEFAULT CHARSET = cp1251;

Ответ MySQL: Документация

#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 '(`user_id`),
  UNIQUE KEY `auth_key` (`auth_key`)
) ENGINE=MyISAM DEFAULT CHAR' at line 13

6

Re: #1064 - You have an error in your SQL syntax...

Запятая пропущена перед PRIMARY KEY.

`max_down_speed` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT  '0', PRIMARY KEY (  `user_id` ) ,

7

Re: #1064 - You have an error in your SQL syntax...

Hanut сказал:

Запятая пропущена перед PRIMARY KEY.

`max_down_speed` BIGINT( 20 ) UNSIGNED NOT NULL DEFAULT  '0', PRIMARY KEY (  `user_id` ) ,

Спасибо!