Home >Database >Mysql Tutorial >How to start and use mysql database
Start MySQL as a background service
Enter at the command line: net start mysql
It will show that the MySQL service has been started successfully. success.
Note: If an error message of "access denied"
appears here, run in administrator mode.
Close the MySQL service
Enter at the command line: net stop mysql
It will show that the MySQL service has been stopped successfully. success.
Start MySQL in command mode
Enter the following command to run: mysqld --console
Note: This The command does not require administrator rights. This way to start the MySQL server, once the open command prompt is closed, the service will also be shut down.
Using this method, you can see the console output of the database for easy debugging.
Note, because the service will stop after closing the command prompt in this way, you need to open another command prompt to perform SQL operations.
Log in to MySQL account
Directly enter mysql -u username -p
in the command line to log in to the MySQL command line.
-u, followed by the username.
After entering the command, you need to enter the password.
Enter the MySQL command line to use the command line to perform SQL operations.
The above is the detailed content of How to start and use mysql database. For more information, please follow other related articles on the PHP Chinese website!