Database Connection Error After Restart the Laragon 2.0.2
I got a weird error when I restarted the Laragon 2.0.2.
PDOException in Connector.php line 55: SQLSTATE[HY000]  Plugin '*3918CE79279A697D6D96A1D06883D2106C5B84CE' is not loaded
First of all, I created an user account (i.e. Dadobotuser) that is only able to access one of my databases (let's call it Dadobot database). I was able to access the Dadobot database via a Laravel application with Dadobotuser. After I closed and restarted the Laragon, the error came out. The solution I found to solve the error is to re-create an user account for the Dadobot database. The error will come again after I close and restart the Laragon (I have been doing this a few times).
Another better solution is to use the root user to access the database, and no error occurs with the root user.
I tested the same thing on other Laravel application just to be sure whether it is a problem from Laragon 2.0.2, and the same error occurs.
The internal DBs of MySQL 5.7 are not compatible with MariaDB 10.1, so you faced the issue.
To overcome this there are 3 options:
- The easiest & fastest: Use root user, if you are concern about security use Laragon's reset and generate random root password feature to secure root.
- Add another MariaDB: If you don't use JSON data type, let's use MariaDB for performance. I made a tutorial how to add one here:
- If you insist, you can upgrade the current schemas of MySQL server to 5.7:
After upgrading you must use root with a password and you can not switch MySQL versions
For me, I choose option 1 or 2, but it's up to you.
@DarkSpirit because of MySQL 5.7
The fastest workaround is modify the "user" table of "mysql" database.
Use phpmyadmin then login with root then open the database mysql > table user. You will see the same as the image below at the line of Dadobot record.
- Erase value of authentication_string. From 'N' to empty.
- Copy data of plugin to authentication_string.
- Erase value of plugin.
- Restart MySQL.
Hope this help.
BTW: I prefer MariaDB
Before I start implementing those solutions, I want to ask how did you know I was using MariaDB?
I believe the default database for Laravel is MYSQL right? Please correct me if I am wrong. I did not do any changes on the default database for my Laravel application, so it should be MYSQL not MariaDB. Sorry... I am really confused.
I did know nothing about MariaDB (I just went to google it, and it seems like an alternative to MYSQL).
@DarkSpirit : I don't know if you used MariaDB or not, but what you know about MySQL can tranfer to MariaDB seamlessly.
After googling, I think you got what it is
it seems like an alternative to MYSQL
Just used too much time with this issue..
Clean install of Laragon, new user to database, restart servers and boom! this error of Plugin ...crap... is not loaded.
No MariaDB installed, no anything special..only basic install. So it's all about MySQL issues (?)
Only proper solution for me was to which to MariaDb..
I don't want to manually fix this every time I restart servers (not really a viable solution?) :P
Or I could use root login ofcourse..
Bug report regarding this issue
As usual, MariaDb seems to function much better than MySQL..