Home  >  Article  >  Database  >  How to install mysql in cmd?

How to install mysql in cmd?

青灯夜游
青灯夜游Original
2019-05-22 12:35:1514159browse

How to install mysql in cmd?

Steps to install mysql in cmd:

1. Download the installation package

Website: https://dev .mysql.com/downloads/mysql/

How to install mysql in cmd?

How to install mysql in cmd?

##2. Install mysql

1 , Extract the downloaded installation package to the specified directory (remember the decompression address)

2. Open the cmd window as an administrator and switch the directory to the bin directory where the file is extracted.

How to install mysql in cmd?

3. Use the

mysqld install command to install

How to install mysql in cmd?

4. Execute The following command

mysqld --initialize-insecure --user=mysql

After executing the above command, MySQL will create a data folder and build a default database. The logged-in user name is root and the password is empty

How to install mysql in cmd?

5. Start the service

Execute the following command to start the mysql service

net start mysql

How to install mysql in cmd?

6. Command to log in and change the password;


mysql -u root -p

The default password is empty


Set password


update user set password=password(“123456”) where user=“root”;

How to install mysql in cmd?

How to install mysql in cmd?##7 , Refresh permissions:

flush privileges;

8, Exit:

quit;

Note:

This configuration method is applicable to versions below MySQL 5.7. Versions 5.7 and above lack the data directory compared to previous versions, so they are not suitable for this installation method.

Related learning recommendations:
java basic tutorial

The above is the detailed content of How to install mysql in cmd?. 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
Previous article:What does order mean?Next article:What does order mean?