MySQL 8 Compatibility With PHP 5

Search for a command to run...

No comments yet. Be the first to comment.
Most AI agents that support scheduled tasks have two sources of instruction when a cron job fires: The cron prompt — the task-specific instructions you wrote when scheduling the job The skill — a re

TL;DR Scarp draw result, host on GitHub, retrieve it like API at damacai.hongineer.com. Data Scraping I have previously shared a technique for scraping Da Ma Cai draw result. Now I finally have time t

This is a Bash script that check if the replica (slave) health status. If there is an issue, it will exist with non-zero status. This is useful when used with monitoring tools like [Monit](https://mmo

chmod is a command-line utility used to change the access permissions of file system objects such as files and directories. It allows you to control who can read, write, and execute those objects. Changing Permissions Using Octal Notation Example Usa...
chown changes the ownership of files and directories. This involves modifying the user and/or group associated with a file, determining who has access and permissions. Changing File Ownership to a Specific User Example Usage: chown user file.txt What...
I am maintaining a legacy PHP 5.6 Laravel application. It uses a MySQL DB maintained by another department, and I have no ownership over it. That DB was recently upgraded to version 8 and it is not compatible with my application. This is how I resolve the issue.
These some of the error messages shown when PHP code connects to MySQL 8 server.(HY000/2054): Server sent charset unknown to the client.
The server requested authentication method unknown to the client [caching_sha2_password]
This is due to MySQL 8 changing the default authentication plugin to caching_sha2_password, and default character set to utf8bm4.
Set user password using mysql_native_password plugin.
# For new user
CREATE USER 'foobar'@'host' IDENTIFIED WITH mysql_native_password BY 'password';
# For existing user
ALTER USER 'foobar'@'host' IDENTIFIED WITH mysql_native_password BY 'password';
Add this to MySQL config file (my.cnf).
[mysqld]
collation-server=utf8_unicode_ci
character-set-server=utf8
default-authentication-plugin=mysql_native_password
Restart MySQL server for the change to take effect.
I found a similar article specific to CentOS 7: How to Run PHP 5 Applications with MySQL 8.0 on CentOS 7