Home >Database >Mysql Tutorial >How to install mysql in cmd?
Steps to install mysql in cmd:
1. Download the installation package
Website: https://dev .mysql.com/downloads/mysql/
##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.mysqld install command to install
mysqld --initialize-insecure --user=mysqlAfter 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
net start mysql
mysql -u root -pThe default password is empty
update user set password=password(“123456”) where user=“root”;
##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!