DBD::mysql requires MySQL 8.x for building (am using 5.7.44)
Closed this issue ยท 6 comments
DBD::mysql version
Any from cpan
MySQL client version
5.7.44
Server version
5.7.44
Operating system version
Rocky (Centos) 8
What happened?
I have a custom compiled Perl v5.38.0, and we use mysql 5.7
when trying to install with cpan
cpan DBD::mysql
I get
DBD::mysql requires MySQL 8.x for building. Version reported by mysql_config --version: 5.7.44 at Makefile.PL line 450, line 3.
Warning: No success on command[/opt/perl/bin/perl Makefile.PL]
DVEEDEN/DBD-mysql-5.002.tar.gz
/opt/perl/bin/perl Makefile.PL -- NOT OK
Is there any way around this ?
Thanks
Other information
No response
I can see this restriction is in the Makefile
if ($str !~ /^8./) {
Does anyone know if there is a specific reason for this, will stuff not work with 5.7.x ?
Ok, so have installed 5.001 specifically.
I suspect this may catch a few people out, as it feels like a very breaking change, and it's not clear if it's necessarily (rather than advice).
Edit: Actually, it didn't complete correct, investigating
Edit: Ok, have got it in there, but editing the release check for 5.001 as it seemed to check only for v4, odd.
Hi @ibrierley
The official upstream support for MySQL 5.7 has ended. See https://www.mysql.com/support/eol-notice.html for details.
The GA version of MySQL 8.0 was released on 2018-04-19 (about 5 years ago).
During the time of MySQL 8.0 many features have been added. Other products would probably have changed their major version multiple times. However MySQL didn't do this.
To revive DBD::mysql there is a lot of work to do and keeping things compatible with all versions of MySQL 8.0, 8.1, etc is difficult enough. That's why I decided to remove support for MySQL 5.7 and earlier and MariaDB. I also removed support for MySQL Fabric and libmysqld. Keeping things compatible with all versions of both MariaDB and MySQL would need more time and effort and I rather spend that on resolving as many issues as possible.
Some enhancements that I'm looking into like #386 require MySQL 8.0 or newer as well.
As example, some types in MySQL like my_bool
and my_ulonglong
have been replaced with their native types in MySQL 8.0.
Note that there are a few possibilities for you:
- Use DBD::mysql v4. I intent to keep v4 around for situations like this. Just don't expect any major changes/improvements in v4.
- Compile DBD::mysql against MySQL 8.x client libraries and keep using MySQL 5.7 as server.
- Use DBD::mysql as provided by your OS.
You can also try switching to DBD::MariaDB. It still supports 5.7 and there are no plans to remove the support.
It is rather unfortunate that running cpanm DBD::mysql
on perl:latest
docker image fails. No I know that isn't necessarily a project goal, however, it is an impediment to users who hit quite a hard wall at that point.
For anyone seeking to switch to DBD::MariaDB, I've written a blog post detailing a bit of what to watch out for: https://blogs.perl.org/users/grinnz/2023/12/migrating-from-dbdmysql-to-dbdmariadb.html