Auto increment by 1 in MySQL with clearDB

若如初见. 提交于 2019-12-22 04:56:10

问题


I am using Windows Azure with clearDB. Current database auto-increment value is 10. I want it as 1.

I tried to run these commands in PHPMyAdmin with,

1)

set global auto_increment_increment = 1;
set global auto_increment_offset = 1;

ERROR: #1227 - Access denied; you need (at least one of) the SUPER privilege(s) for this operation

2)

set auto_increment_increment = 1;
set auto_increment_offset = 1;

After that I checked it by this command,

SHOW VARIABLES LIKE 'auto_inc%';

RESULT:

Variable_name                 Value     
auto_increment_increment      10
auto_increment_offset         1

What could be the reason?


回答1:


When I submitted ticket to clearDB, They replied me like this:

ClearDB uses circular replication to provide master-master MySQL support. As such, certain things such as auto_increment keys (or sequences) must be configured in order for one master not to use the same key as the other, in all cases. We do this by configuring MySQL to skip certain keys, and by enforcing MySQL to use a specific offset for each key used. The reason why we use a value of 10 instead of 2 is for future development.



来源:https://stackoverflow.com/questions/26002784/auto-increment-by-1-in-mysql-with-cleardb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!