1汽车增量在MySQL中使用clearDB [英] Auto increment by 1 in MySQL with clearDB
问题描述
我使用的Windows Azure与clearDB。当前数据库中自动递增值是10,我希望它为1。
I am using Windows Azure with clearDB. Current database auto-increment value is 10. I want it as 1.
我试着在phpMyAdmin使用,
I tried to run these commands in PHPMyAdmin with,
1)
set global auto_increment_increment = 1;
set global auto_increment_offset = 1;
错误:#1227 - 访问被拒绝;需要(至少一个)对SUPER特权(个),该操作
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%';
结果:
Variable_name Value
auto_increment_increment 10
auto_increment_offset 1
这可能是什么原因?
What could be the reason?
推荐答案
在我提交门票clearDB,他们说我这个样子:
When I submitted ticket to clearDB, They replied me like this:
ClearDB使用循环复制来提供主 - 主MySQL的支持。
因此,一定的东西,如AUTO_INCREMENT键(或序列)必须是
为了配置一个主不使用相同的密钥,另外,
在所有情况下。我们通过配置MySQL来跳过某些键,并通过
执行的MySQL使用特定用于所使用的每个键偏移。
为什么我们使用的10,而不是2的值的原因是为未来的发展。
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.
这篇关于1汽车增量在MySQL中使用clearDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!