How to start MySQL from the Windows command line

Source: Internet
Author: User

To start the MYSQLD server from the command line, you should start the console window (or "DOS window") and enter the command:

c:\> C:\Program files\mysql\mysql Server 5.0\bin\mysqld

Depending on the location of the MySQL installation in the system, the path used in the previous example is different.

In a non-NT version of Windows, start mysqld in the background. That is, after the server starts, you should be able to see the following command prompt. If you use this method to start the server in Windows NT, 2000, XP, or 2003, the server runs in the foreground, and the command prompt does not appear until the server exits. Therefore, when the server is running, you should open another console window to run the client program.

The following command can stop the MySQL server:

c:\> C:\Program files\mysql\mysql Server 5.0\bin\mysqladmin-u root shutdown

This command calls the MySQL administration tool mysqladmin to connect to the server and tells it to shut down the service. This command uses the MySQL root user connection, which is the default management account in the MySQL permissions system. Please note that users in the MySQL permissions system are completely independent of the Logged-in users under Windows.

If Mysqld does not start, check the error log to see if the server has written any messages that show the cause of the problem. The error log is located in the C:\Program files\mysql\mysql Server 5.1\data directory. is a file with the suffix. Err. You can also try to start the server as Mysqld--console, where you can get some useful information from the window to help resolve the problem.

The last option is to start the mysqld with--standalone--debug. At this point, Mysqld writes to the log file C:\mysqld.trace and should contain the reason why mysqld does not start.

Use mysqld--verbose--help to display all the options for mysqld.

It is helpful to start MySQL from the Windows command line as described above.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.