SQL創(chuàng)建新用戶時默認的密碼長度是8位,如果長度不滿足8位,此時會報錯:“Your password does not satisfy the current policy requirements”,這時候需要對默認的密碼長度進行修改:
show variables like 'varidate_password%';? ? /*查看變量中是否有密碼校驗*/
select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'varidate';? ?/*查看變量中是否有校驗類插件*/
若果沒有,需要安裝:
install plugin validate_password soname 'varidate_password.so';? ? /*安裝密碼校驗插件*/
select plugin_name,plugin_status from information_schema.plugins where plugin_name like 'varidate';? ? /*查看是否安裝成功*/
show plugins;? ? /*查看嚴格限制密碼的插件“validate_password%”*/
show variables like 'validate_password%';? ? /*查看相關變量*/
set global validate_password_policy=0;? ?
/*設置密碼強度等級為0(0:只查長度;1:數(shù)字、大小寫、字符;2:查特殊字符字典文件)*/
set global validate_password_length=4;? ? /*設置密碼長度為4*/
flush privileges;? ? /*刷新權限*/
show variables like 'validate_password%';? ? ?/*再次查看*/
現(xiàn)在就可以隨心所欲設置密碼了。