Error 2003: Unable to connect to MySQL server on "localhost" (10061)

I am trying to learn MySQL, so I downloaded MySQL v5.5 for Windows 7 and selected the developer settings. Open a command prompt, enter

mysql -u root -p 

and get the following: error

2003: Unable to connect to MySQL server on "localhost" (10061)

How can i fix this? I am typing:

 sc query mysql 

and get:

STATE: 1 STOPPED

I'm trying to:

  sc start mysql 

and get:

[SC] StartService: OpenService FAILED 5: Access denied.

I also checked: Control Panel: Administrative Tools: Services

MySQL55 is started, but MySQL is stopped. MySQL is looking for the MySQL Server 5.1 folder, so I'm not sure why I need it, but when I try to start it, I get:

"Windows could not start the MySQL service on the local computer. 2: The system cannot find the specified file."

Thanks.

+10
mysql windows-7
source share
10 answers

I could not call mysql from the command line after 15 hours of effort, so I left. Instead, I installed version 4.1.22. If you go to the mysql main web page, you will not find it in archive 4.1.22. Instead, I searched for mysql 4.1 in google. Hope they didn’t delete it when you try it.

I downloaded the Essentials Package and chose the typical installation option. Then I went to Start → MySQL ... Setup Wizard for the MySQL server instance and select "Install as a Windows Service" and "Include the Bean Directory." There is a drop-down field where I could choose a name, for example, "MySQL" or something else. He complained when I chose MySQL, stating that I already had the installation. I changed it, then it installed. From there, I could call mysql from the command line.

If you cannot find v4.1 or want to use v5, then line by line:

http://www.devside.net/guides/windows/mysql

may work with the change, but it did not work after executing their instructions, except for using version 5.5 instead of v5.1.

Good luck.

+5
source share

For other newbies having the same problem as me (Windows 7 64 bit):

Earlier versions of the MySQL installer do not install the Windows service at all (David Newcomb). I spent 2 days searching the web and came across a lot of confusing answers that didn't work for me, and I found the following solution:

net start mysql

when the service is installed, you can enter the above command to start the service. my mysql version is 5.6 (the newest one you need to know), so you don't need to install old versions as suggested.

See MySQL 2003 Error: Can not connect to MySQL server on "localhost" thanks to @David Newcomb's answer.

+7
source share

Check if the MYSQL service is installed in services.msc If not, go to services.msc and check if the Windows firewall is working. if so, stop it.

  • open cmd as administrator and go to the bin folder of your MYSQL installation.
  • type mysqld --install. He will successfully install the service.

Now start the MYSQL services and try to configure the same.

+3
source share

Start the MySql service from the control panel.

Enabling the MySql service in Windows 7 Control Panel \ All Control Panel Items \ Administrative Tools Open Services, then enable MySql service
From the command line mysql -u root -p mysql and enter the password as admin, which is the default password

It will work

0
source share

Go to the type Run services.msc . Check if MySQL services are running or not. If not, run it manually. After it starts, enter mysqlshow to check the service.

0
source share

open cmd in admin mode and type

  cd C: \ Program Files (x86) \ MySQL \ MySQL Server 5.0 \ bin \ 
  mysql --defaults-file = "C: \ Program Files (x86) \ MySQL \ MySQL Server 5.0 \ my.bin" -u root -p 
where C: \ Program Files (x86) \ MySQL \ MySQL Server 5.0 \ is the installation directory and my.ini is the configuration file.
0
source share

In Windows 10, I ran into a similar problem, and the above commands did not work for me.

But when I started working with the taskbar option, I did not know that there was an item in the taskbar for this.

Adding a screenshot to show exactly where it appears enter image description here

0
source share

Today, the easiest way to install and configure your mysql server is to download and use the "MySQL Installer", which should solve your problem.

0
source share

Here are a few steps you should follow that work in my case:

step1: open cmd with dir as C:\mysql\bin

Step 2: type C:\mysql\bin>mysqld --console hit Enter

step 3: open cmd again with dir C:\mysql\bin>

Step 4: enter the command: C:\mysql\bin>mysql -u root -p enter password : ****(whatever your password) hit Enter

Step 5: you can see mysql> {write your mysql queries here}

0
source share

First of all, you need to check if the service is working or not.

If not, start the MySQL service.

To start the MySQL service:

In Windows 10, press the Windows key, enter the services that are open as administrator, and right-click this MySQL service to start it.

Check the port number, if not the default is 3306, then you need to mention

how mysql -u root -ppassword --port = 3307 referred to this link. http://dba.fyicenter.com/faq/mysql/Connect-to-MySQL-on-Specific-Port.html

-one
source share

All Articles