Coder Social home page Coder Social logo

Comments (6)

chytons avatar chytons commented on August 21, 2024 1

Hi @chytons,

I reviewed the logs you provided, and it appears that MySQL is unable to use the designated data directory C:\laragon\data\mysql-8. Here are a few steps you can take to troubleshoot and resolve this issue:

Check Directory Permissions: Ensure that the C:\laragon\data\mysql-8\ directory has the correct permissions. The MySQL server needs read/write access to this directory.

Check Directory Path: Verify that the directory path C:\laragon\data\mysql-8\ exists and is correct. If there were any typos or changes in the path, MySQL would not be able to access it.

Check Ownership: Make sure the MySQL process has ownership of the C:\laragon\data\mysql-8\ directory. The directory should be owned by the same user account that runs the MySQL server.

Remove Corrupted Files: The log suggests removing all files that the server added to the directory. It might be helpful to back up any important data and then remove or rename the C:\laragon\data\mysql-8\ directory. Afterward, restart the MySQL server to see if it creates a new data directory.

Check MySQL Configuration: Review the MySQL configuration file (my.ini or my.cnf) to ensure that the data directory is correctly specified.

Port Configuration: Since you mentioned changing the MySQL port to 3406, ensure that this change is also reflected in the MySQL configuration file and that no other processes are using this port.

Clean Installation: If the issue persists, consider performing a clean installation of Laragon and MySQL. Ensure that no remnants of previous installations are causing conflicts.

I hope these steps help resolve the issue. If you need further assistance, feel free to reach out.

Best regards, [Tarek] or @LebToki

@LebToki,
After going through the steps, you provided above, it occurred to me that I have an old my.cnf file directly on my C:\ drive which was pointing to XAMPP installation path. This was always read every time I started MySQL server.
After renaming the file, the issue disappeared like magic.

Thanks for all the assistance.

from laragon.

LebToki avatar LebToki commented on August 21, 2024

Do you happen to have another mysql server running ?
from a previous installation ?
have you tried giving MySQL a non-standard port to see if it loads ?
if you happen to have a previous installation i would suggest you move your data to this one and delete the previous installation

from laragon.

chytons avatar chytons commented on August 21, 2024

I have portable version of XAMPP on my system. I start/stop Apache and MySQL manually. Neither XAMPP's Apache nor MySQL was running while troubleshooting Laragon issue. I have changed the folder path where XAMPP is installed in case of conflict. I have completely removed XAMPP using Revo UninstallerPro tool, but a reference is being made to the delete location of XAMPP installation. I have also changed MySQL port to 3406. I have given full control permission on C:\laragon to Authenticated Users and Users.
I set up two Windows 10 VMs and laragon installations in them are working. I copied the mysql-8 folder from one of the VM into the same location of my system. MySQL started running but exited with error after some seconds. I have attached all the relevant screen captures here.

mysql_error.log

mysql_error.log

laragon-mysql-error

laragon_mysql_error.mp4

from laragon.

LebToki avatar LebToki commented on August 21, 2024

Hi @chytons,

I reviewed the logs you provided, and it appears that MySQL is unable to use the designated data directory C:\laragon\data\mysql-8\. Here are a few steps you can take to troubleshoot and resolve this issue:

Check Directory Permissions:
Ensure that the C:\laragon\data\mysql-8\ directory has the correct permissions. The MySQL server needs read/write access to this directory.

Check Directory Path:
Verify that the directory path C:\laragon\data\mysql-8\ exists and is correct. If there were any typos or changes in the path, MySQL would not be able to access it.

Check Ownership:
Make sure the MySQL process has ownership of the C:\laragon\data\mysql-8\ directory. The directory should be owned by the same user account that runs the MySQL server.

Remove Corrupted Files:
The log suggests removing all files that the server added to the directory. It might be helpful to back up any important data and then remove or rename the C:\laragon\data\mysql-8\ directory. Afterward, restart the MySQL server to see if it creates a new data directory.

Check MySQL Configuration:
Review the MySQL configuration file (my.ini or my.cnf) to ensure that the data directory is correctly specified.

Port Configuration:
Since you mentioned changing the MySQL port to 3406, ensure that this change is also reflected in the MySQL configuration file and that no other processes are using this port.

Clean Installation:
If the issue persists, consider performing a clean installation of Laragon and MySQL. Ensure that no remnants of previous installations are causing conflicts.

I hope these steps help resolve the issue. If you need further assistance, feel free to reach out.

Best regards,
[Tarek] or @LebToki

from laragon.

LebToki avatar LebToki commented on August 21, 2024

Do me and yourself a favor!
can you check Task Manager and search for MySQLd (is it running ?)
it could be that you had Xampp installed with persistant services (auto Starting on their own with Windows)
for the sake to finding if this is true in your case .
End the service ---
--------------------Run MySQL in Laragon
if this works then we have to find a way to remove your redundant MySQL server/service

from laragon.

LebToki avatar LebToki commented on August 21, 2024
@echo off
cd /D %~dp0

echo Shutting down MySQL...

REM Check if mysqld.exe is running and kill the process
tasklist /FI "IMAGENAME eq mysqld.exe" 2>NUL | find /I /N "mysqld.exe">NUL
if "%ERRORLEVEL%"=="0" (
    echo mysqld.exe found, terminating process...
    taskkill /F /IM mysqld.exe
) else (
    echo mysqld.exe not found, skipping process termination.
)

REM Check for MySQL installation directory
if exist "C:\xampp\mysql\data" (
    set MYSQL_DIR=C:\xampp\mysql\data
) else if exist "D:\xampp\mysql\data" (
    set MYSQL_DIR=D:\xampp\mysql\data
) else (
    echo MySQL installation directory not found in default locations.
    goto exit
)

echo MySQL installation directory found at %MYSQL_DIR%.

REM Remove auto-run service request from XAMPP
echo Disabling MySQL service auto-start in XAMPP...
sc config MySQL start= disabled
if "%ERRORLEVEL%"=="0" (
    echo MySQL service auto-start disabled successfully.
) else (
    echo Failed to disable MySQL service auto-start.
)

:exit
echo Operation completed.
pause

Explanation:

Shutting down MySQL:

  • Uses tasklist to check if mysqld.exe is running.
  • Uses taskkill to terminate mysqld.exe if it is found running.

Check for MySQL installation directory:

  • Checks if C:\xampp\mysql\data or D:\xampp\mysql\data exists.
  • Sets the MYSQL_DIR variable to the detected directory.

Remove auto-run service request from XAMPP:

  • Uses sc config to disable the MySQL service from starting automatically.

Usage:

  • Save the above code as mysql_cleanup.bat.

Just Remember to run the batch file as an administrator.

from laragon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.