MySQL Password - Howto (Laragon 2.1+)

  • | 3564 points

    Brief: How to set the root password for MySQL to something other than blank.

    Laravel Version: 2.1+
    Works on Lower Version: Possibly - not tested.


    • Start Laragon;
    • Stop the MySQL service if it is running (Laragon will tell you to if you forget);
    • Enter the new password;
    • Start the MySQL service again if you would like it running.

    There are a few ways to test if this worked:

    • Start the MySQL service if it is not started;
    • Right click the Laragon icon and with the Laragon->Database method go to Laragon's PHPMyAdmin (you may need to be running a web-server for this to work but we'll assume you have Nginx or Apache running else it's unclear why you might be using Laragon);
    • Use the username "root" and the password you entered above;
    • If you see the PHPMyAdmin page come up with no errors it worked.

    Any error should be obvious.

    Another way:

    • Start the MySQL service if it is not started;
    • Start the web server (Apache / Nginx) if not started;
    • Make a Laravel project by right clicking the Laragon icon and with the Quick Create choose Laravel - it will require a database - WARNING: this may download quite a lot from the Internet so watch out if you're bandwidth poor;
    • In the command prompt window you'll see a failure to create a database if Laragon has misconfigured itself.

    Another possible way, but possibly not as useful:

    • Find Laragon's laragon.ini;
    • Easiest by right clicking the Laragon icon and then Laragon->Settings file: laragon.ini;
    • Look for an entry called MySQLRootPassword - it is encrypted but so you won't be able to figure out if it is the "right" one but at least you'll be able to see that some password has been set.

    BTW sometimes the Laragon icon may be hidden in the system tray or in the set of icons that appear when you click the "up" looking arrow in the Windows 10 taskbar (usually one or more icons to the left of the 'time').

Log in to reply

Looks like your connection to Laragon was lost, please wait while we try to reconnect.