Home>Article>Database> How to start mysql in windows

How to start mysql in windows

醉折花枝作酒筹
醉折花枝作酒筹 forward
2021-05-18 09:50:25 36330browse

This article will introduce to you how to start mysql. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.

How to start mysql in windows

1. Dos window to start mysql:

1. Windows R Enter cmd to start the dos window;

Input:

net start mysql Start the mysql service

net stop mysql Close the mysql service

2. Enter:

mysql -hlocalhost -uroot -proot to enter the mysql database, where -h Indicates the server name, localhost means local;

-u is the database user name, root is the mysql default user name; -p is the password, if a password is set, you can enter it directly after -p.

Note:

Your mysql is not installed on the C drive (sometimes mysql cannot be entered when installed on the C drive). Mysql cannot be entered. You need to use it first. The DOS command enters the bin directory under the mysql installation directory. Take my computer as an example:

Enter the D drive: enter

cd D:\Tools\MySQL5.5.25\bin to enter the bin directory of mysql before entering

mysql -hlocalhost -uroot -p123456

3. Enter show databases; display the databases you have (commands in the mysql database must end with a semicolon ";");

4. use databases name; select the database to be operated;

5. show tables; display the tables in the selected database;

6. If you want to exit the mysql database, enter exit; press Enter.

2. Click to start mysql

1. Right-click "My Computer" and select "Manage";

2. Select "Serve Applications" and then select "Service";

3. Find "MySQL" and click "Start" on the right side.

Related recommendations: "mysql tutorial"

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

Statement:
This article is reproduced at:csdn.net. If there is any infringement, please contact admin@php.cn delete