Ubuntu 16.04 mysql_old_password 无法加载

Erd*_*tin 5 mysql ubuntu

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

 mysql -uXXXXXX -pYYYYYY -h domain.com
Run Code Online (Sandbox Code Playgroud)

我得到错误:

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
Run Code Online (Sandbox Code Playgroud)

小智 5

也许您只需要通过运行以下命令来安装 mysql (mariadb) 客户端:

sudo apt-get install mariadb-client
Run Code Online (Sandbox Code Playgroud)

当我遇到这个问题时,上面的命令在我的 Ubuntu 16.04.2 LTS 安装上修复了它。


小智 -1

你的mysql是什么版本?

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

执行本机身份验证的插件,将密码与帐户行的密码列进行匹配。mysql_native_password 插件基于本机密码哈希方法实现身份验证。mysql_old_password 插件基于较旧的(4.1 之前)密码哈希方法(现已弃用)实现本机身份验证。

您可以尝试传递插件选项,例如

mysql --default-auth=mysql_old_password -u XXXXXX -pYYYYYY -h domain.com
Run Code Online (Sandbox Code Playgroud)

参考:7.1.2 旧的原生认证插件