Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP Version and compatibility with MySQL 8

Tags:

php

mysql

I need to setup a database server which will be serving 4-5 different PHP applications - each hosted in their own hosting server.

All these PHP applications are using different PHP versions e.g. App 1 is still using PHP 5.5, App 2 has PHP 7.0, App 3 has PHP 7.2.8, App 4 has PHP 7.2.28, App 5 has PHP 7.4

My current database server is on a separate server which has MySQL 5.5. I am planning to setup MySQL 8 in a brand new server and move all the data from older server to new server. I will manually dump, fix any compatibility issues and restore into MySQL 8.

Would all these different PHP versions work with this latest MySQL 8? I have learnt there is different authentication in MySQL 8 but as I'll be setting up new users in this new setup, will that still create any issues in the older PHP apps?

like image 555
TigerTiger Avatar asked Nov 15 '25 21:11

TigerTiger


2 Answers

Both latest MariaDB and latest MySQL will work with any version of PHP. Choosing between MariaDB and MySQL is a choise you have to decide yourself. While there are differencies between MariaDB and MySQL, they are functionally very close each other.

like image 95
slaakso Avatar answered Nov 17 '25 11:11

slaakso


I am not aware of any issues with PHP and MySQL 8. The issues with authentication methods were fixed in PHP 7.4 (since 7.4.4 should be working perfectly fine).

Both extensions (mysqli and PDO) can be used to talk to MySQL 8, but PDO is a much better choice than mysqli. However, mysqli is not going away, and you can still use it.

PHP has an extension called mysqlnd which stands for MySQL native driver. This driver is used by both mysqli and PDO_mysql. It is here, where the bug of the missing authentication method was located.

When you upgrade to MySQL 8, you should be able to continue using PHP 7.4 without any issues.

like image 25
Dharman Avatar answered Nov 17 '25 12:11

Dharman



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!