Comments (6)
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.
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.
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.
laragon_mysql_error.mp4
from laragon.
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.
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.
@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)
- MySQL 8.4.0 : default_authentication_plugin=mysql_native_password has been removed HOT 7
- configuration won't open
- It's a nice app, but ; HOT 2
- Can I control laragon using command line
- Is laragon able to serve multiple directories? HOT 1
- Is Laragon able to server projects with specifc version of php? HOT 3
- Laragone HOT 1
- Shutting down the server for too long and how to automatically removing mysqld HOT 3
- How to configure this setting of disable Node.js HOT 4
- Laragon has two bugs HOT 5
- Any MySQL version below 8 fails to launch HOT 1
- Hello, how can I setup websocket using nginx?
- Laragon, Laravel and Jetstream HOT 1
- Unable to downgrade MySQL from 8 to 5 HOT 1
- Adding RoadRunner to boosts php apps
- Oh no! laragon detected exceptions, Provider Load failure.... HOT 1
- Issues with Installing Laragon on Windows - Cannot get Administrator Permissions HOT 1
- Can't open or close Laragon when minimized to tray.
- wordpress doesnt install by quickapp HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laragon.