Start, connect, disconnect and stop the MySQL database
1. Start the MySQL server
There are two ways to start the MySQL server: system server and command prompt (DOS).
Method 1: Start the MySQL server through the system server.
If MySQL is set as a Windows service, you can open the Windows Service Manager by selecting the "Start"/"Administrative Tools"/"Services" command. Find the mysql service in the server list, right-click it, and select the "Start" command in the pop-up shortcut menu to start the MySQL server.
Method 2: Start the MySQL server in the command prompt
Select the "Start"/"Run" command, enter the cmd command in the pop-up "Run" dialog box, and open the DOS window. Enter:
net start mysql
and press Enter to start the server.
Note: Although the method of opening the server is very simple, under normal circumstances, it is recommended not to stop MySQL, otherwise the database will not be usable.
2. Connect to the MySQL server
Click the start button, open cmd, find and enter the database installation folder, take mine as an example, mine is in mysql\ bin folder, the steps are as follows:
First find the database to see which disk it is installed on, enter it, and then find the installation folder. After finding it, enter mysql -uroot -proot to successfully connect to the database.
-u is followed by the user name of the database -p is followed by the password of the database
The specific operation results are as follows:
d: cd phpStudy\mysql\bin mysql -uroot -proot
At this point, we have connected Log in to the database
3. Disconnect the MySQL server
After connecting to the MySQL server, you can enter the exit or quit command at the MySQL prompt to disconnect the MySQL connection, as follows :
MySQL>quit;
4. Stop the server
There are three ways to stop the server:
The first one: stop through the system server
It’s the opposite of how we opened it. If MySQL is set up as a Windows service, you can open the Windows Service Manager by selecting the Start/Administrative Tools/Services command. Find the mysql service in the server list, right-click it, and select the "Stop" command in the pop-up shortcut menu to stop the MySQL server.
Second type: Stop at the command prompt
Open the DOS window and enter at the command prompt:
net stop mysql
Press Enter on a single machine MySQL server can be stopped.
Third method: Use the mysqladmin command to stop
Open the DOS command window, enter:
mysqladmin -uroot shutdown -proot
and press Enter to stop the server.
The above is the detailed content of Start, connect, disconnect and stop the MySQL database. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











WPS is a very widely used office software, including documents, forms and PPT, and supports multi-terminal synchronization. If the prompt "The source application for this object cannot be launched" appears when editing wps, how to solve it? This problem may occur because you are trying to open a link or file, but its source application no longer exists or has been deleted. Here are some fixes: 1. Reinstall WPS software: Try reinstalling WPSOffice to fix the problem and make sure you are using the latest version. 2. Manually change the default program: Try to change the default program to WPS. You can right-click the file you want to open, select "Open with", and then

Reinstalling the system may not be a foolproof solution, but after reinstalling, I found that when the computer is turned on, it will display white text on a black background, and then give a prompt: rebootandselectproperbootdevice, what is going on? Such a prompt is usually caused by a boot error. In order to help everyone, the editor has brought you a solution. Computer use is becoming more and more popular, and computer failures are becoming more and more common. No, recently some users encountered a black screen when turning on the computer, and prompted Reboot and Select Proper Boot device, and the computer system could not start normally. What's going on? How to solve it? The user is confused. Next, the editor will follow

How to connect the keep body fat scale? Keep has a specially designed body fat scale, but most users do not know how to connect the keep body fat scale. Next is the graphic tutorial on the connection method of the keep body fat scale that the editor brings to users. , interested users come and take a look! How to connect the keep body fat scale 1. First open the keep software, go to the main page, click [My] in the lower right corner, and select [Smart Hardware]; 2. Then on the My Smart Devices page, click the [Add Device] button in the middle; 3 , then select the device you want to add interface, select [Smart Body Fat/Weight Scale]; 4. Then on the device model selection page, click the [keep body fat scale] option; 5. Finally, in the interface shown below, finally [Add Now] at the bottom

As technology continues to develop, the need to use different operating systems is becoming more and more common. For Apple users, sometimes you may need to install and use two different operating systems on one device, such as macOS and Windows. In this case, it is particularly important to set the startup sequence of the dual system. This article will introduce how to set up Apple devices to start the dual system first when turning on the device. First, we need to make sure that both operating systems have been successfully installed on the Apple device. You can use BootCamp this Apple

When you use the Edge browser to access web pages, have you ever encountered a prompt that your connection is not a dedicated connection, causing web browsing to fail? How is this going? Many friends don’t know how to deal with this problem. You can take a look at the following three solutions. Method 1 (simple and crude): In the edge browser, you can try to solve the problem of the website being inaccessible by entering the settings and turning off the security function, and then blocking location permissions in the website permissions. It is important to note that the effectiveness and duration of this approach may vary, and specific effects cannot be determined. After restarting your browser, you can try visiting the website to see if the issue is resolved. Method 2: Adjust the keyboard to English input

When wallpaperengine starts, there are 4 different options. Many users don't know which one to choose when starting wallpaperengine. Generally, when wallpaperengine starts, choose the first one: start 32-bit. Which one to choose when starting wallpaperengine? Answer: Start 32-bit. 1. Generally, when wallpaperengine starts, select the first one: start 32-bit. 2. When wallpaperengine starts, there are 4 different options: start 32-bit; start 64-bit. 3. Start 32-bit: This is a generally recommended option and suitable for most users. 4. Start 64-bit: If the system supports 64-bit, you can choose this option

Solutions to Restricted Network Connections in Win10 With the rapid development of technology, the Internet has become an indispensable part of people's lives. However, sometimes we may encounter some problems when connecting to the Internet on computers using the Windows 10 operating system, one of which is restricted connections. In this case, we cannot access web pages, download files, or use network functions normally. So, is there any way to solve this problem? This article will introduce you to several common solutions. 1. Check the network connection settings. First, I

What does 0x0000011b mean when connecting to a printer? Users often encounter various error codes when using computers, laptops or other devices. Among them, 0x0000011b is a common printer connection error code. So, what does connecting printer 0x0000011b mean? First, we need to understand the basic principles of printer connection. When we need to print files from the computer, we usually need to connect the printer to the computer for data transfer between the two. This connection can be made via
