Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when upgrading MySQL database schema during v.5.3 to v.5.4 upgrading. #2424

Closed
leonid-xorcom opened this issue Aug 2, 2020 · 1 comment

Comments

@leonid-xorcom
Copy link

The recommended My SQL quires for database schema change during Kamailio upgrading from v.5.3 to 5.4 fails:

mysql> ALTER TABLE version ADD COLUMN `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

The correct command is:

mysql> ALTER TABLE `version` ADD COLUMN `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, ADD PRIMARY KEY (`id`);
Query OK, 0 rows affected (0.80 sec)

In this case the second recommended command

ALTER TABLE version ADD PRIMARY KEY (`id`);

is not needed.

Tested on Ubuntu 18.04, with mysql v.5.7.31

Best regards,
Leonid Fainshtein

@miconda
Copy link
Member

miconda commented Aug 3, 2020

Thanks, wiki updated!

@miconda miconda closed this as completed Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants