How to start MySQL server on windows xp

2019-03-08 15:37发布

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?

17条回答
Bombasti
2楼-- · 2019-03-08 16:11
mysql -u root -p

After entering this command in terminal, it will ask for password Enter the password and you are ready to go!

查看更多
\"骚年 ilove
3楼-- · 2019-03-08 16:13

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 execute E:\mysql-5.1.39-win32\bin>mysql -u root

查看更多
forever°为你锁心
4楼-- · 2019-03-08 16:13
  • Run your command prompt as administrator.#

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
查看更多
够拽才男人
5楼-- · 2019-03-08 16:13

probably this will help you I was also having problem with starting MySql server but run command as mention right mark in picture . Its working fine .

查看更多
Evening l夕情丶
6楼-- · 2019-03-08 16:16

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:

  1. Create a new folder named "data" in MYSQL installation directory (i.e. in the same location as where "bin" directory is located. For me it is: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64. This location will vary as per the location where you have extracted the MYSQL zip file)
  2. From here I will use my MYSQL folder location as reference. Go to: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64\bin and execute the command: mysqld --initialize-insecure or mysqld --initialize depending on whether you want the server to generate a random initial password for the 'root'@'localhost' account.
  3. To start the DB, go to: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64\bin and execute mysqld --console You can see the start-up logs being printed.
  4. To connect to DB, go to: C:\programs\mysql-5.7.15-winx64\mysql-5.7.15-winx64\bin and execute mysql -u root -p. When prompted, Enter password if it has been set or else just hit "Enter" button to connect
查看更多
【Aperson】
7楼-- · 2019-03-08 16:16

The error complains about localhost rather than permissions and the current practice in MySQL is to have a bind-address specifying localhost 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?

查看更多
登录 后发表回答