Question

I have this table which was migrated from an older version of mysql:

> SHOW COLUMNS from tbl
(output modified below for posting)

watch_id           | int(11)      | NO   | PRI | NULL  
user_id            | varchar(125) | YES  | MUL | NULL
type               | int(11)      | YES  | MUL | NULL
range              | int(10)      | YES  |     | NULL
active             | tinyint(4)   | NO   |     | 1

"range" is a reserved word in current versions

ALTER TABLE `db`.`tbl` CHANGE COLUMN `range` `watch_range` INT(10) DEFAULT NULL;

Results in

ERROR 1054 (42S22): Unknown column 'range' in 'tbl'

Any ideas?

NOTE: When I originally posted this I made a typo, the sql has:

`range` not `range' as I originally posted
Was it helpful?

Solution

as @eggyal suggested

ran mysql_upgrade
ran repair

then

dumped the database and removed it
imported the dump
restarted mysql

worked, no idea why

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top