Home  >  Article  >  Database  >  mysql start close

mysql start close

WBOY
WBOYOriginal
2023-05-23 11:41:07678browse

MySQL is a popular open source database management system that can meet the needs of enterprise-level data storage and query. When using MySQL, you may encounter situations where you need to start or shut down MySQL. This article will show you how to start and shut down MySQL.

MySQL Start
In the Linux operating system, there is an easy way to start MySQL: use the following command in the terminal:

sudo service mysql start

If you To start MySQL in a Windows system, you can follow the steps below:

1. Open the MySQL installation directory, such as "C:Program FilesMySQLMySQL Server 8.0 in".

2. Open the command prompt with administrator privileges.

3. Enter the "cd C:Program FilesMySQLMySQL Server 8.0 in" command in the command prompt to enter the MySQL installation directory.

4. Enter the "mysql.exe -u root -p" command in the command prompt to log in to MySQL.

5. Enter the MySQL administrator password.

6. Enter the "net start mysql" command in the command prompt to start MySQL.

Through the above steps, you have successfully started MySQL.

MySQL shutdown
In the Linux operating system, shutting down MySQL is also very simple. You only need to use the following command in the terminal:

sudo service mysql stop

If you want to shut down MySQL in Windows system, you can follow the following steps:

1. Open the MySQL installation directory, such as "C:Program FilesMySQLMySQL Server 8.0 in".

2. Open the command prompt with administrator privileges.

3. Enter the "cd C:Program FilesMySQLMySQL Server 8.0 in" command in the command prompt to enter the MySQL installation directory.

4. Enter the "mysql.exe -u root -p" command in the command prompt to log in to MySQL.

5. Enter the MySQL administrator password.

6. Enter the "net stop mysql" command in the command prompt to shut down MySQL.

Through the above steps, you have successfully closed MySQL.

Summary
Starting and shutting down MySQL is not difficult, you just need to master some basic operations. In Linux systems, the task of starting and shutting down MySQL can be easily completed using the "sudo service mysql start/stop" command. In Windows systems, use the "mysql.exe -u root -p" and "net start/stop mysql" commands in the bin folder in the MySQL installation directory to start and shut down MySQL. I hope the method introduced in this article can help you start and shut down MySQL quickly.

The above is the detailed content of mysql start close. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn