You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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.
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
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.
MySQL 8.0.4 : New Default Authentication Plugin : caching_sha2_password
https://mysqlserverteam.com/mysql-8-0-4-new-default-authentication-plugin-caching_sha2_password/
caching_sha2_password-Compatible Clients and Connectors
https://dev.mysql.com/doc/refman/8.0/en/upgrading-from-previous-series.html#upgrade-caching-sha2-password-compatible-connectors
Operating system
Windows 10
GDAL version and provenance
C:\Users\yyamasak>gdalinfo --version
GDAL 2.3.1, released 2018/06/22
The text was updated successfully, but these errors were encountered: