6

I want to connect to the mysql database on the external server with shell command. Ubuntu version 16.04.

 mysql -uXXXXXX -pYYYYYY -h domain.com

I get error:

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
Erdem Çetin
  • 491
  • 1
  • 5
  • 21
  • I think /usr/lib/mysql/plugin/mysql_old_password.so is not exist. Please check it. – Meiram Chuzhenbayev Dec 26 '16 at 09:28
  • older password versions have been deprecated in recent MySQL versions. from 5.7.5 onwards, you need a hashed password, see also https://dev.mysql.com/doc/refman/5.7/en/password-hashing.html – Sandra Aug 16 '17 at 09:57

3 Answers3

5

Maybe you simply need to install the mysql (mariadb) client by running like:

sudo apt-get install mariadb-client

The above command fixed it on my Ubuntu 16.04.2 LTS installation when I had this very issue.

Chris
  • 81
  • 1
  • 5
2

Password hashing has changed since MySQL 5.7.5, so many clients and recent MySQL versions don't support unsafe, pre-4.1 passwords anymore.

To make your password more secure, follow the steps from Cannot connect to MySQL 4.1+ using old authentication

With access to the server: https://stackoverflow.com/a/1576473/1875965 Check your current configuration and the current password settings, find and change users with old passwords

Without access to the server: https://stackoverflow.com/a/2901706/1875965 Connect to the server with an old client, change your password and update the settings

Sandra
  • 374
  • 6
  • 17
-1

what is the version of your mysql ?

The old password hashing method has been deprecated.

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).

you can try passing the plugin option like,

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

Reference: 7.1.2 The Old Native Authentication Plugin

  • this won't work if your version of mysql is more recent. re-configure your password using the steps on https://stackoverflow.com/questions/1575807/cannot-connect-to-mysql-4-1-using-old-authentication (the second answer works with a client that supports an older version of mysql if you don't have access to the msyql server) – Sandra Aug 16 '17 at 10:01