69

How do I restart MySQL on Windows 7?

I'm using HeidiSql as a front end and there's no option in there.

The only other things I have is the MySQL 5.5 command line client.

the
  • 21,007
  • 11
  • 68
  • 101
Norman
  • 6,159
  • 23
  • 88
  • 141

9 Answers9

117

Open the command prompt and enter the following commands:

net stop MySQL   
net start MySQL

the MySQL service name maybe changes based on the version you installed. In my situation, MySQL version is MySQL Server 5.7. So I use the following command

net stop MySQL57   
net start MySQL57
the
  • 21,007
  • 11
  • 68
  • 101
ORION
  • 2,374
  • 2
  • 22
  • 31
  • 9
    This gives me `The service name is invalid` – Catfish Jan 17 '14 at 15:53
  • 2
    Did you cd to the Mysql directory (C:\Program Files\MySQL\MySQL Server 5.x\bin) before first executing those two commands? – PiggyMacPigPig Feb 10 '14 at 15:38
  • 5
    @KennethPurtell It's a Windows thing, not a MySQL binary. The problem for me was that the name of the service was `MySQL56`. To find your service name you could for example go through the steps Frizz1977 suggested. – keyser Jul 02 '14 at 09:54
  • 1
    This gives me: "System error 5 has occurred. Access is denied." – Muleskinner Oct 30 '14 at 12:57
  • 7
    Run the program as **Administrator** if you get `Access is denied` message – zanderwar Dec 01 '14 at 10:08
  • This works for me. My MySQL server version is 8.0 So I ran net start MySQL80. Thanks – Piyush Bansal May 28 '18 at 06:32
  • For MySql 8.0. These commands worked with little tweak 1. net stop MySQL80 2. net start MySQL80 Although cmd prompt printed that MYSQL could not be started , it actually worked with my services – Viraj Nalawade Aug 29 '21 at 05:45
38

You can restart the service through the UI by following these steps:

  1. Open task manager (may need to run as administrator)

  2. Click on the "Service" button and find the "MySql" service

    NOTE: In some cases, the "MySql" service will be named whatever you named the initial database when you created the server. For example, if you called the initial database "myfirstdb", then the service would be called "myfirstdb". You should be able to find the service by sorting by the "Description" column as the description will be blank.

  3. Right-click on the "MySql" service and choose the "Restart" option

Thanks to @Doug_Ivison and @Lucky for the service name notes and "run as administrator" clarification in the comments.

enter image description here

enter image description here

Tim Hutchison
  • 3,483
  • 9
  • 40
  • 76
Frizz1977
  • 1,121
  • 13
  • 21
  • 2
    Good to also suggest a solution using the actual windows UI – Wilt Apr 28 '14 at 12:12
  • 1
    Giving me "Access Denied" Error. – Muhammad Saqib Jul 28 '14 at 18:35
  • 3
    In our case, the windows service for MySQL is not named for MySQL, but has the name of the instance / initial database created using it. (So, if we'd named our initial database "ourmysqldb", I guess our service would have been named "ourmysqldb".) Also, like Frizz1977's example service shown above of "MySQL56", our MySQL windows service actually stands out for its *lack* of any description column. (We're using the "MySQL Server 5.6") – Doug_Ivison Oct 27 '15 at 18:54
  • 3
    @MuhammadSaqib Run `Services.msc` as administrator. – Lucky Apr 25 '17 at 11:04
20

In Windows,

  • Open Run Window by Win+R
  • Type services.msc
  • Search MySQL service (Sometimes found as MySQL56 or MySQL57) based on version installed.
  • Click stop, start or restart the service option.
Lucky
  • 16,787
  • 19
  • 117
  • 151
7

These suggestions so far only work if the mysql server is installed as a windows service.

If it is not installed as a service, you can start the server by using the Windows Start button ==> Run, then browse to the /bin folder under your mysql installation path and execute mysqld. Or just open a command window in the bin folder and type: mysqld

Jeff Northrup
  • 71
  • 1
  • 1
4

First try:

net stop MySQL   
net start MySQL

If that does not work, try using the windows interface:

Start > Control Panel > System and Security > Administrative Tools > Services

Look for your version of MySQL (In my case - MySQL55), highlight and click the green start arrow. The status should change to "Started"

Amac
  • 158
  • 1
  • 8
3

use net stop mysql57 instead, it should be the version that is not specified

Oussama L.
  • 1,842
  • 6
  • 25
  • 31
1

I just have the same problem, just open the task manager, go to services tab and search MySQL_One service, rigth click and start, this works for very good.

0

Ctrl + alt +delete to start TASK MANAGER ,choose Service ,Then you will find MySQL, click that item by right click,then choose start, your MySQL Server will start!

NightWind
  • 21
  • 1
-1

In order to prevent 'Access Denied' error:

Start -> search 'Services' -> right click -> Run as admistrator

armatita
  • 12,825
  • 8
  • 48
  • 49
d3vnico
  • 93
  • 8