Starting MySQL from the Windows Command Line

SERVER:

Starting MySQL from the Windows Command Line

MySQL server can be started manually from the command line. It can be implemented in any version of Windows.

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

C:\> C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld

Depending on the installation location of the system MySQL, the path used in the preceding examples are also different.

In non-NT versions of Windows, start mysqld in the background. That is, after the server is started, you should be able to see the back of the command prompt. If you use this method in Windows NT, 2000, XP or 2003 start the server, the server is running in the foreground, before the server exits, the command prompt does not appear. Therefore, when the server is running, it should open another console window to run client programs.

The following command to stop MySQL server:

C:\> C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqladmin -u root shutdown

This command invokes the MySQL administration tool mysqladmin connect to the server and tell it to shut. The command uses the MySQL root user connections, MySQL permissions system which is the default administrative account. Please note that the MySQL grant system is completely independent of the user under Windows login user.

If mysqld does not start, check the error log to see whether the server wrote any message cause of the problem. Error log is located C: \ Program Files \ MySQL \ MySQL Server 5.1 \ data directory. It is a file with a suffix of .err. You can also try to start the server as mysqld --console; this time, you can get some useful information from the window, you can help solve the problem.

The last option is to start mysqld with --debug --standalone. At this point, mysqld writes a log file C: \ mysqld.trace, should include the reasons mysqld does not start.

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

CLIENT:

mysql -uroot -p password

 

Guess you like

Origin www.cnblogs.com/jiangxiaobo/p/11546712.html