《Mysql必讀mysql_connect(): Connection using old (pre-4.1.1) authentication protocol refused》要點:
本文介紹了Mysql必讀mysql_connect(): Connection using old (pre-4.1.1) authentication protocol refused,希望對您有用。如果有疑問,可以聯系我們。
MYSQL必讀做了一下mysql升級,開發機上mysql升級到5.6版本,結果連接一些低版本的mysql服務器報出如下異常:
Warning: mysql_connect(): Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)
MYSQL必讀異常原因在于服務器端的暗碼管理協議陳舊,使用的是舊有的用戶暗碼格式存儲;但是客戶端升級之后采用了新的暗碼格式.mysql5.6版本遇到這種不一致的情況就會拒絕連接.
MYSQL必讀詳見mysql手冊“Server Command Options”一節中“--secure-auth"選項的說明:http://dev.mysql.com/doc/refman/5.6/en/server-options.html#option_mysqld_secure-auth
MYSQL必讀
解決辦法有如下三種:
MYSQL必讀1、服務器端升級啟用secure_auth選項;
MYSQL必讀2、客戶端連接時off掉secure_auth,即連接時加上--secure_auth=off,如:mysql -p10.51.1.11 -P3308 -uroot --secure_auth=off
MYSQL必讀3、找到對應的mysql用戶把暗碼改為新的加密方式,PASSWORD(‘your password'),如:
MYSQL必讀對于辦法二,使用在程序做相應mysql配置即可,以php為例,在php.ini中設置secure_auth=off
歡迎參與《Mysql必讀mysql_connect(): Connection using old (pre-4.1.1) authentication protocol refused》討論,分享您的想法,維易PHP學院為您提供專業教程。