Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MySQL Utilities with MySQL 8 Server

As part of our build process, we use the mysqldiff utility (invoked from maven) to validate our database migration scripts by comparing a freshly-built copy of the schema to a version of the schema created from a baseline plus our migration script. This all works fine with MySQL 5.7.

We are looking to upgrade to MySQL 8.0.13. The database user has been configured to use mysql_native_password. When we run our build, we are getting this error from mysqldiff:

ERROR: Authentication plugin 'caching_sha2_password' is not supported

We understand that this error is due to the fact that the utility is using an old version of mysql-python-connector. We also understand that the answer might be as simple as upgrading the connector version, but we don't know how to go about trying that.

The MySQL Utilities can be found at https://github.com/mysql/mysql-utilities.

On Windows 10, we install using the Oracle windows installer. On Amazon Linux, we install with yum.

NOTE:

  1. The MySQL Utilities appear to be based on an embedded python2.7 installation (we do not have standalone python installed on any of the development or build machines).
  2. We do not have python expertise, so detailed steps will be helpful if we are mucking with the embedded python stuff.
  3. We need to solve this problem both on Windows 10 and Amazon Linux.

How do we work around this error so that we can use mysqldiff with a MySQL 8.0.13 server on Windows 10 and Amazon Linux?

If the answer is simply to upgrade the connector, what are the detailed steps for doing that?

Are there server installation/configuration changes we can make to support clients connecting with old drivers?

like image 400
Rob Avatar asked Oct 31 '18 23:10

Rob


People also ask

What are the MySQL clients and utilities?

The first one is usually called mysql-server. This package contains the server and all utilities to connect to the server. The second package is called mysql-client and contains only the utilities. We can use it to connect to a server on a reachable location elsewhere.

Is MySQL 8.0 stable?

MySQL 8.0 increases the overall reliability of MySQL because : MySQL 8.0 stores its meta-data into InnoDB, a proven transactional storage engine. System tables such as Users and Privileges as well as Data Dictionary tables now reside in InnoDB. MySQL 8.0 eliminates one source of potential inconsistency.


1 Answers

I have managed to run mysqldiff.py against mysql 8, with some patches:

clone the patched source code and enter its dir:

$ git clone https://github.com/georgexsh/mysql-utilities.git

create a virtualenv and activate it:

$ virtualenv -p python2 venv
$ . venv/bin/activate

install the newer mysql connector:

(venv) $ pip install mysql-connector-python>=8.0

install mysql-utilities to the current virtualenv:

(venv) $ pip install .

now mysqldiff.py is able to run. if you want to run without activate virtualenv, you use its full path:

/path/to/mysql-utilities/venv/bin/mysqldiff.py

steps under windows are mostly the same, except virtualenv activation:

venv\Scripts\activate.bat
like image 134
georgexsh Avatar answered Oct 03 '22 03:10

georgexsh