Home > Database > Mysql Tutorial > body text

How to install mysql in cmd?

青灯夜游
Release: 2020-09-17 15:39:36
Original
14174 people have browsed it

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
Copy after login

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
Copy after login

How to install mysql in cmd?

6. Command to log in and change the password;


mysql -u root -p
Copy after login

The default password is empty


Set password


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

How to install mysql in cmd?

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

flush privileges;
Copy after login

8, Exit:

quit;
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!