Whenever I try to start MySQl by typing:
> mysql -u root
I'm getting an error:
ERROR 2003(HY000): Can't connect to MySQL server on 'localhost' (10061)
How can I solve above problem? I just downloaded MySQL and unzipped in E drive, I have not done anything. Do I have to make connection first? if yes, how can I do?
After entering this command in terminal, it will ask for password Enter the password and you are ready to go!
first thing you need to do is to start the mysql for that you can use
E:\mysql-5.1.39-win32\bin>net start mysql
(only when there a mysql running as service) then you can executeE:\mysql-5.1.39-win32\bin>mysql -u root
We can start MySQL service from windows command line using the below command.
net start mysql
Command to stop MySql service:
net stop mysql
Disable MySql service:
sc config mysql start= disabled
Command to enable MySql service(to automatically start MySQL service when the system starts up):
sc config mysql start= auto
Command to set the startup type to manual:
sc config mysql start= manual
How to restart MySql service? There is no direct command to restart a service. You can combine stop and start commands like below.
net stop mysql & net start mysql
I was also having problem with starting MySql server but run command as mention right mark in picture . Its working fine .
Here is the ZIP file that I had downloaded: mysql-5.7.15-winx64.zip
Here are the steps to start MYSQL Server (mysql-5.7.15-winx64) for the first time on Windows:
mysqld --initialize-insecure
ormysqld --initialize
depending on whether you want the server to generate a random initial password for the 'root'@'localhost' account.mysqld --console
You can see the start-up logs being printed.mysql -u root -p
. When prompted, Enter password if it has been set or else just hit "Enter" button to connectThe error complains about
localhost
rather than permissions and the current practice in MySQL is to have a bind-address specifyinglocalhost
only in a configuration file.So I don't think it's a password problem - except that you say you 'unzipped' MySQL.
Is that enough installation? What did you download?
Was there any installation step which allowed you to define a root password?
And, as NawaMan said, is the server running?