leokhoa / laragon

Laragon is a portable, isolated, fast & powerful universal development environment for PHP, Node.js, Python, Java, Go, Ruby. It is fast, lightweight, easy-to-use and easy-to-extend.
https://laragon.org
4.43k stars 369 forks source link

Laragon 6.0, MariaDB 10.5.17 change root password fails, PHPMyAdmin connection problems, database corruption in Windows 10/11 #338

Open MackSix opened 2 years ago

MackSix commented 2 years ago

There is a problem with MariaDB >> Change root password with Laragon Full 6.0 220916.

The Laragon console indicates it is trying to set a random password rather than the password given and fails. It manages to change the password to something radom anyway, the database might start again, but will soon fail to start.

See attached screenshot.

Laragon console

I tried this on 2 different desktops with Windows 10 & Windows 11. MariaDB 10.5.17 winX64

MackSix commented 2 years ago

I tried MariaDB 10.6.10 winx64 and 10.7.6 winX64. It appeared to work with no errors one time on Windows 10 with 10.6.10 and then failed afterwards. Also, the console came up without running in Administration mode a couple of times on Winodws 10 and then it would not come up again unless I ran in Administration mode. The console never comes up on Windows 11 unless I run in Administration mode.

RobiNN1 commented 2 years ago

Start mysql server and open Terminal (from Laragon). Then run these commands

  1. login to mysql as root

    mysql -u root
  2. set password for root user

    ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

This always works fine, I use only this method because that built-in option in Laragon never worked correctly.

MackSix commented 2 years ago

RobinNN1, have you ever had trouble with MariaDB 10.5.17 winX64 on Windows in general? It seems PHPMyAdmin has problems with that version and is wrecking the database. MariaDB 10.6.10 winX64 is working OK.

I have used your method on MariaDB 10.5.17 before, but soon afterwards, the DB will fail to start.

With MariaDB 10.5.17, PHPMyAdmin has trouble logging in and if I restart Apache and DB, it will load, but then it may or may not give this error show in this screenshot.

PhpMyAdmin screenshot of a failure

RobiNN1 commented 2 years ago

I only had problems with changing the password with built-in option, but the mysql server worked fine.

MackSix commented 2 years ago

The problem with PHPMyAdmin causing the Warning in .\libraries\classes\Dbal\DbiMysqli.php#209 mysqli::query(): (HY000/2): Error reading file '.\mysql-bin.index' (Errcode: 22 "Invalid argument") error message only happens when MariaDB 10.5.17 is started with Laragon. Either with the button on the control panel or the button on the Largon context menu.

When I install MariaDB 10.5.17 as a Windows service and start and stop it with the Windows Services panel, this doesn't happen. I have no problems with PHPMyAdmin or database corruption now.

This happened on two differenet desktops. One running Windows 10 and one running Windows 11.

People had the same probem with XAMPP, their databae was being corrupted when starting and stopping Maria DB with the XAMPP control panel, even if it was installed as services, it caused a problem. I also had the problem until I started and stopped Maria DB from the Service Panel in Windows.

So, for some reason, MariaDB 10.4.x and 10.5.x has this problem in Windows if not being started and stopped with Windows Services panel.

grooverdan commented 7 months ago

The error comes from the windows ReadFile function - https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-readfile that gets translated to EINVAL via a number of error codes from MariaDB https://github.com/MariaDB/server/blob/11.5/mysys/my_winerr.c#L33.

I recommend starting procmon and looking what system error actually happens for ReadFile on the mysql-binlog.index file. Its probably retriggered with 'show master logs'. If you find something repeatible, can you create an upstream bug report on https://jira.mariadb.org

touqeer-asad commented 5 months ago

Start mysql server and open Terminal (from Laragon). Then run these commands

  1. login to mysql as root
mysql -u root
  1. set password for root user
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

This always works fine, I use only this method because that built-in option in Laragon never worked correctly.

Worked like a charm thanks a lot!

adigamara24 commented 4 weeks ago

Start mysql server and open Terminal (from Laragon). Then run these commands

  1. login to mysql as root
mysql -u root
  1. set password for root user
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';

This always works fine, I use only this method because that built-in option in Laragon never worked correctly.

It's working for me. Thanks