I recently encountered an issue when trying to login to phpMyAdmin. Whenever I attempt to log in, I receive the following error message: "php#1193 - Unknown system variable 'lc_messages'". This error completely blocks me from accessing my database and performing any necessary tasks.
I have been using phpMyAdmin for quite some time without any issues, so this problem came as a surprise. I have not made any recent changes to my setup or configuration, which makes it even more puzzling.
I am using PHP version 7.4.3 and MySQL version 5.7.28 on a CentOS 7 server. I have tried restarting both PHP and MySQL services, but the error remains. I also checked my MySQL configuration file to see if there was any mention of 'lc_messages', but I couldn't find anything.
I have searched online for possible solutions or similar cases, but so far, I haven't come across anything specific to this error. Most of the troubleshooting guides I found were about other phpMyAdmin login issues, not related to this particular 'lc_messages' error.
Can anyone shed some light on what might be causing this problem and how I can go about resolving it? I would greatly appreciate any assistance or guidance in resolving this issue. Thank you in advance!

User 2:
I had a similar frustrating experience with the 'lc_messages' error in phpMyAdmin, and it took me a while to troubleshoot it. After experimenting with different solutions, here's what eventually resolved the issue for me:
1. Locate your MySQL configuration file. On my CentOS server, it was located at `/etc/my.cnf`, but in some cases, it might be located at `/etc/mysql/my.cnf` or another directory.
2. Open the configuration file using a text editor.
3. Look for the `[mysqld]` section within the file. If the section doesn't exist, you can add it at the end of the file.
4. In the `[mysqld]` section, add or modify the following line:
`init_connect='SET collation_connection = utf8_general_ci'`
This line sets the collation connection value to 'utf8_general_ci'. You can adjust this value based on your preferred collation.
5. Save the changes and close the file.
6. Restart the MySQL service to apply the configuration changes. Use the command:
`sudo systemctl restart mysqld`
Now, try accessing phpMyAdmin again. This solution worked for me, and the 'lc_messages' error was no longer present.
I hope this solution works for you too. If you come across any further issues or if you need additional assistance, feel free to ask. Good luck!