Меню

Attempting to start mysql service xampp ошибка

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?

Melebius's user avatar

Melebius

5,9674 gold badges35 silver badges50 bronze badges

asked Jan 22, 2014 at 9:52

BeHaa's user avatar

4

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.

answered Feb 27, 2016 at 8:39

suki ramachandran's user avatar

1

I had an issue with this because I had accidentally installed XAMPP to c:windowsprogram 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.

answered Jan 15, 2017 at 17:51

Eoin's user avatar

EoinEoin

1,3512 gold badges16 silver badges32 bronze badges

2

After Stop xampp, go to configure and change the port 3306 to 3308 of mysql and save. Now start the sql……Enjoy

answered Apr 24, 2016 at 10:16

Alok kumar's user avatar

Alok kumarAlok kumar

811 silver badge1 bronze badge

  1. In the cmd type: services.msc Find MySql and change properties to the disabled.
  2. 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.

TrebledJ's user avatar

TrebledJ

8,4567 gold badges25 silver badges47 bronze badges

answered Feb 10, 2019 at 13:29

surbaniak's user avatar

surbaniaksurbaniak

811 silver badge3 bronze badges

2

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:

  1. Open run (Win + r) and type ‘regedit’. This is where you edit your registry.
  2. Navigate to: HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services > MySql

enter image description here

  1. Click on mySql and notice the ImagePath variable. Right click ‘ImagePath’ and click modify.
  2. 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

answered Oct 4, 2019 at 23:07

Thomas's user avatar

ThomasThomas

2,3161 gold badge8 silver badges16 bronze badges

1

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.

answered Aug 19, 2016 at 8:06

nguyendc's user avatar

1

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 ………

answered Aug 31, 2015 at 9:42

Arghya's user avatar

0

Only for windows
I have fixed the mysql startup issue by following below steps

Steps:

  1. Open CMD and copy paste the command netstat -ano | findstr 3306
    If you get any result for command then the Port 3306 is active

  2. 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

  1. For CMD-> search for cmd from start menu
  2. For Powershell-> search for powershell from start menu

answered Jan 24, 2020 at 11:20

Mohamed Sulaimaan Sheriff's user avatar

Had this problem today, on a Windows 10 machine. Opened C:xamppdatamysql_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:

  1. Open C:xamppmysqlbinmy.ini and add the following line towards the end of [mysqld] section (above the line containing ## UTF 8 Settings):
innodb_flush_method=normal
  1. Restart MySQL service. Should run just fine.

answered Dec 24, 2018 at 7:23

tao's user avatar

taotao

77.1k15 gold badges109 silver badges138 bronze badges

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:xamppmysqlshareerrmsg.sys'

I moved my xampp folder to the root of the drive and it started working.

Hope it helps

answered Feb 4, 2016 at 3:04

Oltamor's user avatar

OltamorOltamor

1211 silver badge4 bronze badges

If you have other testing applications like SQL web batch etc, uninstall them because they are running in port 3306.

answered Nov 8, 2017 at 6:56

Shibhe Tepa's user avatar

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.

answered Feb 26, 2019 at 7:47

SAMPro's user avatar

SAMProSAMPro

1,0561 gold badge18 silver badges38 bronze badges

The problem I had was changing the path of the Xammp folder in the system.

Eric Aya's user avatar

Eric Aya

69k35 gold badges179 silver badges250 bronze badges

answered Dec 12, 2022 at 7:30

mehmet's user avatar

mehmetmehmet

4173 silver badges12 bronze badges

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.

K.Dᴀᴠɪs's user avatar

K.Dᴀᴠɪs

9,88511 gold badges34 silver badges43 bronze badges

answered Dec 12, 2018 at 21:53

radek's user avatar

radekradek

471 silver badge7 bronze badges

Everytime my MySQL starts, it will stop, then I noticed that some files are getting generated in C:xamppmysqldata. 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.

answered Nov 30, 2019 at 15:41

Bawm's user avatar

BawmBawm

693 bronze badges

This worked for me.

  1. Search for Services in Windows Start

enter image description here

  1. Find MySQL in it.

enter image description here

  1. 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.

answered Nov 17, 2021 at 7:03

Kavya Goyal's user avatar

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.

answered Mar 10, 2022 at 14:53

Noor Ahmed's user avatar

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.

answered Oct 20, 2022 at 7:26

Sunil Kumar's user avatar

Sunil KumarSunil Kumar

5,4425 gold badges33 silver badges38 bronze badges

What worked for me was to run xampp «as administrator». Fixed.

answered Nov 14, 2022 at 14:54

user13134936's user avatar

1

I solved this problem by removing all the information in the path

C:xamppmysqldata

And copy the information inside this path

C:xamppmysqlbackup

answered Jan 7 at 16:52

Ali Azmoodeh's user avatar

In Windows, you should go: Start > Run > services.msc > Apache 2.4 > Properties > Start Mode > Automatic > Apply > Start > OK > [Same as MySQL]

answered Jan 19, 2015 at 7:17

Dao Minh Duc's user avatar

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

answered May 2, 2020 at 9:43

Ahmad's user avatar

AhmadAhmad

1,3945 gold badges23 silver badges42 bronze badges

1

Slide 1

Most trusted JOB oriented professional program

DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2

DevOps to DevSecOps – Learn the evolution

DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2

Get certified in the new tech skill to rule the industry

Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2

Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2

Gain expertise and certified yourself

Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3

AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow

next arrow

When I open XAMPP and click start MySQL button and it gives me an error. I had started it just before, but now it isn’t working.

12:19:12 PM [mysql] Attempting to start MySQL app...
12:19:12 PM [mysql] Status change detected: running
12:19:13 PM [mysql] Status change detected: stopped
12:19:13 PM [mysql] Error: MySQL shutdown unexpectedly.
12:19:13 PM [mysql] This may be due to a blocked port, missing dependencies,
12:19:13 PM [mysql] improper privileges, a crash, or a shutdown by another method
12:19:13 PM [mysql] Press the Logs button to view error logs and check
12:19:13 PM [mysql] the Windows Event Viewer for more clues
12:19:13 PM [mysql] If you need more help, copy and post this
12:19:13 PM [mysql] entire log window on the forums

Answer

Stop there! Please do not delete anything!

Some of the answers in Stackoverflow or in other platform could leave completely unusable your database!, so, before deleting files, first try to do what the error message in XAMPP message panel recommend you to do, using the MySQL backup folder which is included with XAMPP. So do the next:

Step 1. Rename the folder c:xamppmysqldata to c:xamppmysqldata_old (you can use any name).

Step 2. Create a new folder c:xamppmysql/data.

Step 3. Copy the content that resides in mysqlbackup to the new mysqldata folder.

Step 4. Copy all your database folders that are in mysqldata_old to mysqldata (skipping the mysql, performance_schema, and phpmyadmin folders from data_old).

Step 5. Finally copy the ibdata1 file from mysqldata_old and replace it inside mysqldata folder.

Step 6. Start MySQL from XAMPP control panel.

And, Its DONE . No databases lost, no ports changed, no run as administrator, no force recovery, no kill mysqld process, no restoring from previous versions, no more errors.

Thanks for Reading.

keep Coding.

  • Author
  • Recent Posts

Email:- contact@DevOpsSchool.com

Nice to be back with another solution for a common (not so) problem which google takes some time to find a proper solution.

As mentioned in the title of the post, this thing happens when i was installing xampp server on my office computer.

After successfully installing the xampp server, i was trying to start the mysql service using the control panel.

But when i start the mysql service, it was trying to start but finally it was failing to start on port 3306. It gave some error about port 3306.

After few hours of google search i realized that the root cause for this issue was that port 3306 is using by another mysql service which was installed from another application. Then i had to change the port number to another one to start the mysql service on xampp server.

To change the port successfully, i had to change the port number in following files in the mentioned manner.

You can change the port number to 3308 from 3306 in xamppmysqlbinmy.ini file in a couple of places.

There is also a couple of default MySQL port settings in the xamppphpphp.ini file that would also need changing.

Save the files and restart Apache and MySQL to test.

Cheers !!!!!!!!!

Я только что установил XAMPP для Windows — должна быть самая новая версия (XAMPP Control Panel v3.2.1).

Apache работает отлично на портах 80 и 443, но MySQL не запускается. Когда я нажимаю кнопку запуска, я получаю это сообщение:

Попытка запуска службы MySQL…

Затем появляется окно и спрашивает меня, хочу ли я разрешить это, чего я хочу. Но после этого ничего не происходит. Я могу нажать столько раз, сколько хочу, но с тем же результатом.

Что я могу сделать с MySQL?

Ответ 1

Измените порт MySQL с 3306 на 3307 или что-то в этом роде.

http://silentlyrun.blogspot.in/2013/02/how-to-change-apache-n-mysql-port-for.html

Надеюсь, это поможет!

Ответ 2

Если вы уже установили MySQL в своих окнах, перейдите в файл services.msc на своих окнах и щелкните правой кнопкой мыши файл MySQL и остановите службу, теперь откройте свой XAMPP и запустите MySQL. Теперь MySQL запустится на порт 3306.

Ответ 3

У меня была проблема с этим, потому что я случайно установил XAMPP в c:windowsprogram files (x86), что вызвало проблему с разрешениями Windows.

В установке говорится, что не устанавливать его там, но я думал, что он сказал, чтобы установить его там.

Я удалил и переустановил на c:xampp, и он сработал.

Ответ 4

Только остановить My sql В Xampp за 15 минут После 15 минут перезапуска Mysql. Если мой sql работает, но порт не отображается в Xampp, а затем нажмите «Config» > my.ini отредактируйте этот файл и измените порт 3306 > 3307 и сохраните и перезапустите xampp………

Ответ 5

Одна из многих причин заключается в том, что xampp не может запускать службу MySQL сам по себе. Все, что вам нужно сделать, — запустить службу mySQL вручную.

Во-первых, убедитесь, что « mysqld.exe» не запущен, если есть, завершите его. (перейдите в Диспетчер задач > вкладка «Прогресс» > щелкните правой кнопкой мыши «mysqld.exe» > конечная задача)

Откройте службу services.msc с помощью Запустить (нажмите «Окно + R» ) > services.msc или На панели управления XAMPP нажмите кнопку «Сервисы» .
Найдите « MySQL«, щелкните правой кнопкой мыши и запустите его.

Ответ 6

После Stop xampp перейдите к настройке и измените порт 3306 на 3308 mysql и сохраните. Теперь запустите sql…… Наслаждайтесь

Ответ 7

Была эта проблема сегодня, на компьютере с Windows 10. Открыл C:xamppdatamysql_error.log и искал строки, содержащие [ERROR].

Последняя строка ошибки была:

... [ERROR] InnoDB: File (unknown): 'close' returned OS error 206. Cannot continue operation

Важное примечание: если ваша ошибка отличается, отправьте ее в Google (скорее всего, вы найдете исправление).

В поиске вышеуказанной ошибки нашел эту ветку на форуме поддержки Apache Friends, которая привела меня к исправлению:

  1. Откройте C:xamppmysqlbinmy.ini и добавьте следующую строку в конец раздела [mysqld] (над строкой, содержащей ## UTF 8 Settings):
innodb_flush_method=normal
  1. Перезапустите службу MySQL. Должен работать просто отлично.

Ответ 8

Вы использовали путь установки по умолчанию?

В моем случае, когда я запустил mysql_start.bat, я получил следующую ошибку:

Can`t find messagefile 'D:xamppmysqlshareerrmsg.sys'

Я переместил папку xampp в корень диска и начал работать.

Надеюсь, что это поможет

Ответ 9

  1. В типе cmd: services.msc Найдите MySql и измените свойства на отключенные.
  2. В панели управления Xampp удалите MySql с помощью флажка слева и установите снова, щелкнув по тому же флажку.

Ответ 10

Если у вас есть другие тестовые приложения, такие как веб-пакет SQL и т.д., удалите их, потому что они работают в порту 3306.

Ответ 11

Я могу поделиться тем, как я решил проблему в моем случае.

Кажется, у меня был установлен MySQL Server 5.7. Он не показывался в списке «Установка и удаление программ» в Windows, поэтому я не знал об этом. Я отметил это после того, как посмотрел журнал XAMPP.

Сразу после запуска XAMPP он показал в журнале, что существует конфликт в mySQL, и указал папку, в которой установлен мой MySQL Server 5.7. Я удалил mySQL 5.7 вручную из Program Files (x86) и папки ProgramData, перезапустил, и тогда XAMPP mySQL запустился нормально.

Я пытался только остановить службу MySQL, но для меня это не сработало. Только ручное удаление всех папок mySQL 5.7, похоже, помогло.

Ответ 12

У меня точно такая же проблема. Наконец-то нашел решение:

Опция Relocate XAMPP в инструменте установки не правильно переместила пути и повредила их, но я вручную изменил каталоги внутри my.ini (base dir, data dir,…). После этого mysql начался успешно.

Ответ 13

Пользователи Windows 10:

У меня тоже была эта проблема. Небольшое расследование помогло, хотя. До этого у меня была проблема, что 3306 использовался. Итак, я узнал, что порт 3306 используется другой программой. В частности, программу JDBC, которую я пытался изучить, и у меня был установлен xammp, прежде чем я попробовал этот JDBC. Итак, я удалил весь файл, и вот я здесь, где вы находитесь. Проблема заключалась в том, что мой ‘ImagePath’ (переменная реестра) был изменен после повторной установки mySql. Проще говоря, xammp больше не знает, где находится ваш mysqld.exe, или файл находится не в том месте, в котором вы его указали. Вот как это исправить:

  1. Откройте run (Win + r) и введите «regedit». Здесь вы можете редактировать свой реестр.
  2. Перейдите к: HKEY_LOCAL_MACHINE> SYSTEM> CurrentControlSet> Службы> MySql

enter image description here

  1. Нажмите на mySql и обратите внимание на переменную ImagePath. Щелкните правой кнопкой мыши «ImagePath» и нажмите «Изменить».
  2. Введите местоположение своего файла xammp mySqld (найдите его в xammp), хотя он, вероятно, совпадает с моим.

Классные источники:

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

 
Спасибо дэйв

Ответ 14

В Windows вы должны пойти: Пуск > Выполнить > services.msc > Apache 2.4 > Свойствa > Режим запускa > Автоматически > Применить > Пуск > OK > [То же, что и MySQL]

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Att ошибка на пионере
  • Atom ошибка при установке плагина