TigerTiger
TigerTiger

Reputation: 115

PHP Version and compatibility with MySQL 8

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?

Upvotes: 4

Views: 19133

Answers (2)

Dharman
Dharman

Reputation: 33316

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.

Upvotes: 3

slaakso
slaakso

Reputation: 9080

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.

Upvotes: 4

Related Questions