Skip to content

Instantly share code, notes, and snippets.

@SHSharkar
Created November 28, 2021 07:23
Show Gist options
  • Save SHSharkar/b7d0cd31228ed4aa540163b921f29deb to your computer and use it in GitHub Desktop.
Save SHSharkar/b7d0cd31228ed4aa540163b921f29deb to your computer and use it in GitHub Desktop.
Laragon MySQL v8.x upgrade / fix

Laragon MySQL v8.x upgrade / fix

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.

  1. Delete Laragon MySQL data directory. If you have already existed databases, make sure to export first. Location path example: C:\laragon\data where the folder contains mysql-8. Delete the mysql-8 folder. You can also delete the mysql folder if not needed.
  2. 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.
  3. Run the COMMAND: mysqld --initialize --console
  4. After running the command, it will initialize MySQL with data directory. And at the last line, you will see a temporary password generated to access MySQL. Copy the temporary password.
  5. Run the command: start mysqld. It will start mysqld in a new window. Leave at it is. Back to the first/ main terminal.
  6. Run the command and access to the MySQL: mysql -u root -p
  7. 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.
  8. Enter the below command: ALTER USER 'root'@'localhost' IDENTIFIED BY '';
  9. Now run exit to exit from MySQL terminal. Another terminal opened while we run start mysqld, press CTRL + C and close the session.
  10. Now close the windows.
  11. Start Laragon again. This time MySQL should work. Access from any DBA apps/ phpMyAdmin etc.
  12. Login username root and password should be blank or empty. It means you don't have to insert the password.
  13. You can change the password. The easiest option is to access from phpMyAdmin and change the password for the root user.
  14. Login to phpMyAdmin -> User Accounts (Top Navbar) -> Select root user -> Change Password (Top Tab) -> Enter Password -> Click GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment