2014-09-23 36 views
6

我在clearDB中使用Windows Azure。當前數據庫中自動遞增值是10,我想把它當作1使用clearDB在MySQL中自動增加1

我試圖在phpMyAdmin與運行這些命令,

1)

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

錯誤:#1227 - 拒絕訪問;你需要(至少一個)SUPER權限(個),此操作

2)

set auto_increment_increment = 1; 
set auto_increment_offset = 1; 

之後,我通過這個命令檢查的話,

SHOW VARIABLES LIKE 'auto_inc%'; 

結果:

Variable_name     Value  
auto_increment_increment  10 
auto_increment_offset   1 

可能是什麼原因?

+1

所以,你需要一個'SUPER' privilidged用戶... – Wrikken 2014-09-23 19:03:51

+0

我登錄的管理員用戶已經在clearDB。 – 2014-09-23 19:04:52

+0

但您沒有'SUPER'特權,這意味着您的管理員用戶並非全能。但是,退一步說:爲什麼你甚至不願意使用自動遞增號碼?你應該沒有什麼理由,而這些通常意味着_depping_增量,而不是設置爲1 .... – Wrikken 2014-09-23 19:24:19

回答

9

當我提交門票clearDB,他們說我這個樣子:

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.