Ubuntu 16.04 mysql_old_password无法加载

问题描述:

我想用shell命令连接到外部服务器上的mysql数据库。 Ubuntu版本16.04。Ubuntu 16.04 mysql_old_password无法加载

mysql -uXXXXXX -pYYYYYY -h domain.com 

我得到错误:

mysql: [Warning] Using a password on the command line interface can be insecure. 
ERROR 2059 (HY000): Authentication plugin 'mysql_old_password' cannot be loaded: /usr/lib/mysql/plugin/mysql_old_password.so: cannot open shared object file: No such file or directory 
+0

我认为/ usr/lib/mysql/p lugin/mysql_old_password.so不存在。请检查一下。 –

+0

旧版密码版本在最近的MySQL版本中已被弃用。从5.7.5开始,你需要一个哈希密码,另请参阅https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html – Sandra

什么是你的mysql的版本?

旧的密码哈希方法已被弃用。

Plugins that perform native authentication that matches the password against the Password column of the account row. The mysql_native_password plugin implements authentication based on the native password hashing method. The mysql_old_password plugin implements native authentication based on the older (pre-4.1) password hashing method (and is now deprecated).

你可以尝试通过插件选项一样,

mysql --default-auth=mysql_old_password -u XXXXXX -pYYYYYY -h domain.com 

参考:7.1.2 The Old Native Authentication Plugin

+0

如果你的mysql版本更多,这将不起作用最近。使用https://stackoverflow.com/questions/1575807/cannot-connect-to-mysql-4-1-using-old-authentication上的步骤重新配置您的密码(第二个答案适用于支持较旧版本的客户端版本的mysql,如果你没有访问msyql服务器的话) – Sandra

也许你只需要运行如下指令安装MySQL(MariaDB的)客户端:

sudo apt-get install mariadb-client 

上述命令将其固定在我的Ubuntu 16.04.2 LTS安装上ñ我有这个问题。

自从MySQL 5.7.5以来,密码散列已经发生了变化,所以很多客户端和最近的MySQL版本不再支持不安全的4.1之前的密码。

为了使你的密码更安全,请按照下列步骤从Cannot connect to MySQL 4.1+ using old authentication

通过访问服务器:https://stackoverflow.com/a/1576473/1875965 检查当前配置和当前密码设置,找到并改变用户的旧密码

没有访问服务器:https://stackoverflow.com/a/2901706/1875965 用旧客户端连接服务器,更改密码并更新设置