XAMPP Mysql won't start - mysql

I've been using XAMPP for a couple of months and suddenly I'm getting an error in XAMPP that I haven't been able to find a solution.
12:07:28 [mysql] Problem detected: MySQL Not Found!
12:07:28 [mysql] Disabling MySQL buttons
12:07:28 [mysql] Run this program from your XAMPP root directory!
This is the error I'm getting from the XAMPP control panel.
When I go to the XAMPP root directory and try to run the mysql_start.bat file it says
mysql\bin\mysqld is not recognized as an internal or external command operable program or batch file
I'm not sure what to do from here to get everything working again.

You have not specified the OS in which you are working. Most possible solution is to install the xampp application as admin and disable anti virus during the installation process. Also disable UAC if in windows. Run the application as administrator. This post is taken from a previously asked question on the same topic. You can find it here
apache and mysql start button are disabled in xampp control panel

Related

Why won't MySQL start on my XAMPP install?

I've been running without any problem Wordpress locally on my W10 x64 PC for over a week.
I turned on my computer this morning, opened XAMPP 3.2.4 and I am unable to start the MySQL module.
"Error: MySQL shutdown unexpectedly."
At first it says:
16:25:35 [mysql] Attempting to start MySQL service... 16:25:35
[mysql] Status change detected: running
And then this:
16:25:43 [mysql] Error: MySQL shutdown unexpectedly.
I tried changing port, reinstalling services, removing some files in the MySQL data folder (trying to follow the online guides about problems similar to mine) but nothing worked.
When I manually try to start the MySQL service I get the error 1067.
I uploaded the error log file here:
https://drive.google.com/file/d/1q-wQm5a5uChF6_6UCsfVEBFoeSvKwh2E/view?usp=sharing
It seems that you have your first warning at:
2019-11-13 14:00:05 6 [Warning] Failed to load slave replication state from table mysql.gtid_slave_pos: 1932: Table 'mysql.gtid_slave_pos' doesn't exist in engine
Do you have a replication schema woriking? if not, you can rename master.info files to avoid replication.
Besides that you have your first error related to files access:
2019-11-13 14:10:32 0 [ERROR] InnoDB: Cannot open datafile for read-only: '.\virtualnordicdb\wp_commentmeta.ibd' OS error: 203
Can you access that file and the file has correct the write/read privileges
And Finally you have space enough in your hard drive?
019-11-13 14:20:25 0 [Note] mysqld.exe: Aria engine: starting recovery
recovered pages: 0% 10%191113 14:20:26 [ERROR] mysqld got exception 0xc0000005 ;
I was able to fix this by unistalling and reinstalling XAMPP.
I then copied the website folder back in htdocs, and finally went to "mysql>data", copied the database folder of the website and pasted the "ibdata1" file that I had before reinstalling XAMPP.
I came up with this solution thanks to this answer on another post:
https://stackoverflow.com/a/50855748/12367579
I have been to this problem thousands of times.
This problem is related to some custom things such as other programs or duplication.
I can give you several solutions:
Check Control Panel
Maybe you have installed your Xampp several times. Go there and check on the bottom. If there are too many Xampp installs, uninstall them all. Don't forget to save your xampp folder with htdocs and mysql.
Check your programs installed on pc
There are too many suspicious programs like Teamviewer or VMWare that block the port of mysql. Try to uninstall it, and install them again after finishing work with your Xampp.
Changing the port
Go to XAMPP Control Panel and near to MYSQL go to Config > my.ini
Search for port=3306, and replace all occurrences' values with 3336.
After that, go to CONFIG at the top on the right, then to Service and Port Settings, after it at MYSQL tab.
On that tab change the value of port to 3336.
After that click save and then quit your XAMPP.

MySQL Server on MAMP-Windows Will Not Start

I am using MAMP 4.1 on Windows 10 and cannot get MySQL server to start. When I uninstalled MAMP and re-installed it MySQL server starts up, but when I stop it, it will not start back up. I also went into the \mamp\db\mysql\ and deleted the four log files hilited below. Then I turned the server off, then back on, but only Apache starts up, not MySQL.
There is also a process running in services called MySQL80. When I try to start it I get the error message shown. I have tried many ways to delete it, including going to the command prompt and using "sc mysql80" and going to 'regedit'. MySQL80 does not show up anywhere so that I can delete it.
Also, the Resource Monitor below shows that Apache is running on port 80, but nothing on port 3306. And yes, my MAMP Preferences are set to port 3306 for MySQL.
When MySQL was running, I had 2 processes of 'mysqld' listening: one session on IPv6 Port 3306, and the other session on IPv4 Port 3306?
What's wrong and how do I fix it?
And, is there suppose to be (2) sessions of 'mysqld' both listening on port 3306 where one is on IPv6 and the other is on IPv4?
Thanks Community.
MAMP Control Panel
mysql80 Service
Resource Window with Ports Listed
MAMP Log Files
I had the same problem. I contacted mamp support, and their answer was the following; it worked for me. Hope this helps you too. Stop all servers in MAMP.
The below assumes your MAMP installation directory is C:\MAMP\.
For MAMP:
With Windows Explorer go to folder C:\MAMP\db\mysql\
First backup all files that begin with mysql-bin.*, then delete them (including mysql-bin.index file.)
Then try starting all MAMP servers again (wait for MySQL to turn light on).
After that stop all MAMP servers again.
You'll now try to disable binary log-bin in MAMP (or MAMP PRO)
Open up MySQL configuration file in text editor of your choice: C:\MAMP\conf\mysql\my.ini
Find following text: log-bin
Comment this line by adding # character at start of line.
#log-bin=mysql-bin
Save and restart servers
After that put the mysql-bin.* files back in their place.
Turn off your MAMP Server.
Locate your db folder for mysql. Example: C:\MAMP\db\mysql
Rename the mysql-bin.index file to mysql-bin_old.index (or anything really)
Turn on your MAMP Server
This is a very common issue with MAMP. If this happened to you out of the blue, this is probably the fix.
This is what I did to solve this issue:
Quit MAMP if open
Navigate to /MAMP/tmp/mysql
Rename mysql.sock.lock
Restart MAMP
my issue was Avast Antivirus blocking MAMP, disabled for 10 minutes and Apache started
I had the same problem today.
I did try removing everything from C:\MAMP\db\mysql\ and tried to restart MAMP & servers. But it failed.
Then I noticed the following error in the mysql log file /MAMP/logs/mysql_error_log.err
[error] Cannot open windows event_log ; check privileges
This basically means that you don't have sufficient access.
So
I replaced all the files that I originally deleted
shutdown the server & MAMP.
Now right click on the MAMP icon & choose run as administrator
Now it starts up normally
Uninstall entire MAMP and also any other xamap and wamp if you install previously.
Check the drive C. No any other folder or file related to this present there.
then reinstall MAMP again. All the problems are solve your apache and mysql both start.
please vote me.
This is what worked for me :
Click on Start Servers in MAMP
Manually click on mysql.exe in
MAMP installation folder (C:\MAMP\bin\mysql\bin\mysql.exe)
Tip : You can pin mysql.exe to Start Menu so you don't always have to search for this folder

How to upgrade MariaDB within Xampp

I want to upgrade to MariaDB 10.2 and I'm using xampp ( I like that mysqld.exe runs in the background and easy On/Off with a single click ). What happens is that the latest version as of now is 3.2.2 and it has MariaDB 10.1.29 comes with it.
I'm looking for a general healthy way to do it.
I've tried those steps that pretty much look good :
Unzipping/installing the new MariaDB then copying the data directory and the config|bat files + phpMyAdmin from the old to the new installation.
After starting for an instant, it shuts down complaining :
13:44:33 [main] Control Panel Ready
13:52:46 [mysql] Attempting to start MySQL app...
13:52:46 [mysql] Status change detected: running
13:52:49 [mysql] Status change detected: stopped
13:52:49 [mysql] Error: MySQL shutdown unexpectedly.
13:52:49 [mysql] This may be due to a blocked port, missing dependencies,
13:52:49 [mysql] improper privileges, a crash, or a shutdown by another method.
13:52:49 [mysql] Press the Logs button to view error logs and check
13:52:49 [mysql] the Windows Event Viewer for more clues
13:52:49 [mysql] If you need more help, copy and post this
13:52:49 [mysql] entire log window on the forums
Notes:
I'm not gonna try some random deletes that are very likely to
make my db tables corrupt (even though I did before and it didn't
work)
Please take notice that if I run the server itself using an unprivileged user
(not administrator) on the command line, it runs as expected.
Furthermore, the status in the Xampp control panel would change to green :
14:00:35 [mysql] Status change detected: running
And I could even shut down the MySQL server from it, by clicking on stop.
If I run Xampp as administrator (which could be a bad idea), I get the same error message above.
Please note also that running MySQL server as an administrator involves security risks.
I know I can run it as a service, but I'd rather like to have instant control over when to turn it On/Off.
The purpose :
Looking for a clean way to upgrade MariaDB within xampp, on windows (Windows7)
I had the exact same issue, how I resolved it was:
Re-installed MariaDB to the x32 version because I installed the x64 first
Copied "my-huge.ini" from "C:\xampp\mysql" to "C:\xampp\mysql\bin\my.ini"
Now everything works as expected, start/stop everything is smooth. I guess there is some specific setting that is not quite correct on the old "my.ini" from XAMMP.
Of course, all this was done after I did these steps:
Be sure all modules are stopped from the XAMPP Control Panel
Downloaded an installer of the latest stable version of MariaDB
Renamed "C:\xampp\mysql" to "C:\xampp\mysql_old"
Installed the downloaded MariaDB to "C:\xampp\mysql"
Copied the following directories to maintain my databases:
C:\xampp\mysql\data
C:\xampp\mysql\scripts
C:\xampp\mysql\share
Run Apache and MySQL module from the XAMPP Control Panel, and done.
For me, I would create dumps of existing databases and uninstall current xampp installation then download newest version of xampp which will of course contain a newer version of mariadb

Xampp MySQL not starting - "Attempting to start MySQL service..."

I've just installed XAMPP for Windows - should be the newest version (XAMPP Control Panel v3.2.1).
Apache is running just fine on port 80 and 443, but MySQL is not starting. When I press the start button, I get this message:
Attempting to start MySQL service...
Then a window pops up and asks me if I want to allow this, which I want. But nothing happens after that. I can press as many times as I want, but with the same result.
What can I do with MySQL?
If you have MySQL already installed on your windows then go to services.msc file on your windows and right click the MySQL file and stop the service, now open your XAMPP and start MySQL. Now MySQL will start on the port 3306.
I had an issue with this because I had accidentally installed XAMPP to c:\windows\program files (x86) which caused a Windows permissions issue.
The installation says not to install it there, but I thought it had said to install it there.
I uninstalled and reinstalled to c:\xampp and it worked.
After Stop xampp, go to configure and change the port 3306 to 3308 of mysql and save. Now start the sql......Enjoy
In the cmd type: services.msc Find MySql and change properties to the disabled.
In the control panel of Xampp uninstall MySql by the checkbox on the left side, and install again by the click in the same checkbox.
Windows 10 Users:
I had this issue too. A little bit of investigating helped out though. I had a problem before this one, that 3306 was being used. So what I found out was that port 3306 was being used by another program. Specifically a JDBC program I was trying to learn and I had xammp installed before I tried this JDBC out. So I deleted the whole file and then here I am, where you're at. The issue was that my 'ImagePath'(registry variable) was changed upon installing mySql again. To put it simply, xammp doesn't know where your mysqld.exe is at anymore, or the file is not in the location that you told it to be. Here's how to fix it:
Open run (Win + r) and type 'regedit'. This is where you edit your registry.
Navigate to: HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > MySql
Click on mySql and notice the ImagePath variable. Right click 'ImagePath' and click modify.
Enter the location of your xammp mySqld file (navigate through xammp to find it) Although it is likely the same as mine.
Cool Sources:
https://superuser.com/questions/222238/how-to-change-path-to-executable-for-a-windows-service/252850
https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/mysql-installation-windows-path.html
Thanks dave
One of many reasons is xampp cannot start MySQL service by itself. Everything you need to do is run mySQL service manually.
First, make sure that 'mysqld.exe' is not running, if have, end it. (go to Task Manager > Progresses Tab > right click 'mysqld.exe' > end task)
Open your services.msc by Run (press 'Window + R') > services.msc or 0n your XAMPP ControlPanel, click 'Services' button.
Find 'MySQL' service, right click and run it.
Only stop My sql In Xampp For 15 Min After 15 min restart Mysql .If my sql running But Port Not Showing in Xampp then Click Config > my.ini edit this file and change port no 3306 > 3307 and save and Restart xampp .........
Only for windows
I have fixed the mysql startup issue by following below steps
Steps:
Open CMD and copy paste the command netstat -ano | findstr 3306
If you get any result for command then the Port 3306 is active
Now we want to kill the active port(3306), so now open powershell and paste the command
Stop-Process -Id (Get-NetTCPConnection -LocalPort 3306).OwningProcess -Force
Where 3306 is active port. Now port will be inactive
Start Mysql service from Xampp which will work fine now
Note: This works only if the port 3306 is in active state. If you didn't get any result from step 1 this method is not applicable. There could be some other errors
For other ports change 3306 to "Required port"
Ways to open CMD and Powershell
For CMD-> search for cmd from start menu
For Powershell-> search for powershell from start menu
Had this problem today, on a Windows 10 machine. Opened C:\xampp\data\mysql_error.log and looked for lines containing [ERROR].
Last error line was:
... [ERROR] InnoDB: File (unknown): 'close' returned OS error 206. Cannot continue operation
Important note: if your error is different, google it (you'll likely find a fix).
Searching for the above error, found this thread on Apache Friends Support Forum, which led me to the fix:
Open C:\xampp\mysql\bin\my.ini and add the following line towards the end of [mysqld] section (above the line containing ## UTF 8 Settings):
innodb_flush_method=normal
Restart MySQL service. Should run just fine.
Did you use the default installation path?
In my case, when i ran mysql_start.bat I got the following error:
Can`t find messagefile 'D:\xampp\mysql\share\errmsg.sys'
I moved my xampp folder to the root of the drive and it started working.
Hope it helps
If you have other testing applications like SQL web batch etc, uninstall them because they are running in port 3306.
I have the same problem. Finally found the solution:
The Relocate XAMPP option in the setup tool didn't correctly relocate the paths and corrupted them, I've manually changed the directories inside my.ini (base dir, data dir , ...). After that mysql started successfully.
The problem I had was changing the path of the Xammp folder in the system.
I can share how I solved the problem in my case.
It seems that somehow I had mySQL Server 5.7 installed. It didn't show on Add/Remove Programs list in Windows tough so I wasn't aware of it. I marked that after I looked up the XAMPP log.
Just after XAMPP launched it has shown in the log that there is a conflict in mySQL and indicated the folder where my mySQL Server 5.7 is installed. I removed mySQL 5.7 manually from Program Files (x86) and ProgramData folder, restarted and XAMPP mySQL started normally then.
I've tried only stopping the mySQL service but for me it didn't work. Only manually deleting all mySQL 5.7 folders seemed to have helped.
Everytime my MySQL starts, it will stop, then I noticed that some files are getting generated in C:\xampp\mysql\data. I tried deleting some files (like the Error logs, err file, etc.) on that directory. Back up first what you're going to delete to avoid losing data.
I don't know how it works. I'm just trying to enable HTTPS in my local machine but then suddenly MySQL can't be started. But now it's working.
I'm using Windows 10 and XAMPP 3.2.4.
This worked for me.
Search for Services in Windows Start
Find MySQL in it.
Right Click and Stop MySQL. Would work on XAMPP Now.
Note: If you wanna use the MYSQL prompt again, you will have to start the MYSQL from Service again.
In my case I had xampp installed with PHP 7.4.
But I needed PHP 8.
I downloaded xampp with PHP 8.
Installed it to C:/xampp8/ folder. When I started the new version, it started successfully.
But then I realized that I needed the database data from the old xampp installation. I stopped the new xampp(php 8 version) , and tried to start xampp (php 7.4 version) and saw that Apache started and was working fine, but mysql was not starting.
I tried many settings but couldn't start mysql from the old xampp.
Solution in my case to copy the data to the new xampp
I went to C:/xampp_old/mysql/data folder. And saw that each of my database has a separate folder inside data folder. I copied all the folders and pasted into
C:/xampp8/mysql/data/
Then I started new xampp and looked in phpmyadmin via browser and I got all my databases back.
In the xampp control panel, to the left of "MySQL" there is a green checkbox, click it to uninstall MySQL service. After that you can start MySQL from the same control panel. You can install those services again, it will still work.
What worked for me was to run xampp "as administrator". Fixed.
I solved this problem by removing all the information in the path
C:\xampp\mysql\data
And copy the information inside this path
C:\xampp\mysql\backup
In Windows, you should go: Start > Run > services.msc > Apache 2.4 > Properties > Start Mode > Automatic > Apply > Start > OK > [Same as MySQL]
if all solutions up did not work for you, make sure the service is running and not set to Disabled!
Go to Services from Control panel and open Services,
Search for Apache2.4 and mysql then switch it to enabled, in the column of status it should be switched to Running

Xampp Mysql wont start

I have read all the posts about this none fix it? please help ive even tryed re-installing my computer and reinstalling xampp
Errors:
00:33:43 [mysql] Problem detected!
00:33:43 [mysql] Port 3306 in use by ""C:\Program Files (x86)\MySQL\MySQL Server 5.1\bin\mysqld" --defaults-file="C:\Program Files (x86)\MySQL\MySQL Server 5.1\my.ini" MySQL"!
00:33:43 [mysql] MySQL WILL NOT start without the configured ports free!
00:33:43 [mysql] You need to uninstall/disable/reconfigure the blocking application
00:33:43 [mysql] or reconfigure MySQL and the Control Panel to listen on a different port
00:33:43 [mysql] Attempting to start MySQL service...
Then i get a user account control to allow changes when i try to start mysql? something to do with net.exe? in C:\Windows, im not sure of the rest of the directory
If i say no to the user account cocntrol then it says this
00:33:49 [mysql] There may be an error, return code: 1223 - The operation was cancelled by the user.
If i say yes nothing happens? Apparently its windows 5.1 erroring? but the directory doesnt even exist? i deleted it all from Program Files and Program Files (x86), Also uninstalled all mysql components? Any thoughts
I had the same problem. I was using standalone MySQl for Java, and then I install XAMPP even after uninstalling stand-alone MySQL, XAMPP MySQL wouldn't start.
The problem is even after uninstalling MySQL MySQL service is normally still in the registry. The solution is to remove MySQL service from registry. The easiest way to do this, run XAMP-control in Administrator mode, and remove MySQL from service list and start MySQL again. That's it
Here is the way to know the program, use netstat -ao
You have the port and the associated pid.
Get the pid for 3306.
Then launch taskmgr
Show column pid (Menu > Select > Column selection > check PID)
You know the program which uses this 3306 port.
Kill it
Restart your XAMP
Then for not starting this "3306 port" program, launch services.msc.
It is certainly a MySQL, search for it and desactivate it at startup.
close Xampp server
go to C:\xampp\mysql\data
delete the ibdata1 file
restart xampp server
yes i already get this, the problem is that you already install MySQL as standalone version OR with VM i guess , and then you install xampp, the solution for that, is open process monitor, and close MySQL, MySQL Server 5.1 then you can start xampp and will work fine ^^
I just uninstall the register service using
sc delete MySQL
and restart my xmapp service; then it works OK.