Solution for: https://laragon.org
If you are setting up MySQL v8.x for the first time for Laragon, you will see that MySQL failed to load and asking for an upgrade the MySQL. Although showing user table not found, plugins table not found errors, etc.
To fix the problem, follow the steps accordingly.
- Delete Laragon MySQL
data
directory. If you have already existeddatabases
, make sure toexport
first. Location path example:C:\laragon\data
where the folder containsmysql-8
. Delete themysql-8
folder. You can also delete themysql
folder if not needed. - Access to the MySQL BIN folder or add the MySQL BIN folder to the windows system environment path. Location example:
C:\laragon\bin\mysql\mysql-8.0.27-winx64\bin
. Open a terminal or navigate the location from Laragon's built-in terminal. - Run the COMMAND:
mysqld --initialize --console
- After running the command, it will initialize MySQL with
data directory
. And at the last line, you will see atemporary password
generated to access MySQL. Copy thetemporary password
. - Run the command:
start mysqld
. It will start mysqld in a new window. Leave at it is. Back to the first/ main terminal. - Run the command and access to the MySQL:
mysql -u root -p
- Use the temporary password that was generated earlier and hit ENTER. You will be accessed to the MySQL from command prompt to make some changes.
- Enter the below command:
ALTER USER 'root'@'localhost' IDENTIFIED BY '';
- Now run
exit
to exit from MySQL terminal. Another terminal opened while we runstart mysqld
, press CTRL + C and close the session. - Now close the windows.
- Start Laragon again. This time MySQL should work. Access from any DBA apps/ phpMyAdmin etc.
- Login username
root
and password should beblank
orempty
. It means you don't have to insert the password. - You can
change the password
. The easiest option is to access fromphpMyAdmin
and change the password for theroot
user. - Login to phpMyAdmin -> User Accounts (Top Navbar) -> Select root user -> Change Password (Top Tab) -> Enter Password -> Click GO