Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ogr2ogr with MySQL 8 (MySQL connect failed with caching_sha2_password plugin) #910

Closed
YoshiakiYamasaki opened this issue Sep 11, 2018 · 2 comments

Comments

@YoshiakiYamasaki
Copy link

Expected behavior and actual behavior.

Steps to reproduce the problem.

ogr2ogr can't connect MySQL 8.0 when MySQL's user is using 'caching_sha2_password plugin' plugin.
(ogr2ogr can connect MySQL 8.0 when MySQL's user is using 'mysql_native_password' plugin.)

[MySQL's user information]
mysql> select user,host,plugin from mysql.user where user like 'test%';
+--------------+-----------+-----------------------+
| user | host | plugin |
+--------------+-----------+-----------------------+
| test_default | localhost | caching_sha2_password |
| test_native | localhost | mysql_native_password |
+--------------+-----------+-----------------------+
2 rows in set (0.00 sec)

[Connect failed case]
C:\Users\yyamasak>ogr2ogr -f "MySQL" MYSQL:geotest,user=test_default,password=test C:\work\point_2449.shp
ERROR 1: MySQL connect failed for: geotest,user=test_default,password=XXXXXXXXXXXXXXXXXXX plugin 'caching_sha2_password' cannot be loaded: ÄwÆΦé│éΩé╜âéâWâàü[âïé¬î⌐é┬é⌐éΦé▄é╣é±üB

ERROR 1: MySQL driver doesn't currently support database creation.
Please create database before using.
ERROR 1: MySQL driver failed to create MYSQL:geotest,user=test_default,password=XXXX

[Connect success case]
C:\Users\yyamasak>ogr2ogr -f "MySQL" MYSQL:geotest,user=test_native,password=test C:\work\point_2449.shp
ERROR 1: MySQL error message:FUNCTION geotest.GeometryFromText does not exist Description: INSERT INTO point_2449 (SHAPE , gid, point_name) VALUES (GeometryFromText('POINT (-25967.1563870895 -91961.8549916338)',1) , 1, 'nagoya_station')
ERROR 1: Unable to write feature 0 from layer point_2449.
ERROR 1: Terminating translation prematurely after failed
translation of layer point_2449 (use -skipfailures to skip errors)

[Note]
MySQL 8.0 changed default authentication plugin. We can connect MySQL 8.0 with caching_sha2_password plugin using compatible clients.

Operating system

Windows 10

GDAL version and provenance

C:\Users\yyamasak>gdalinfo --version
GDAL 2.3.1, released 2018/06/22

@rouault
Copy link
Member

rouault commented Sep 11, 2018

That's not an issue with the GDAL source code, but with the libmysql-client library used at runtime not being recent enough. So if you used gisinternals builds, that should be reported to https://github.com/gisinternals/buildsystem/issues

@YoshiakiYamasaki
Copy link
Author

I submitted following issue.

libmysql-client version is old for MySQL 8.0 #132
gisinternals/buildsystem#132

@rouault rouault closed this as completed Sep 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants