Article Directory
- 1. MySQL installation
-
- 1. Download the MySQL compressed package
- 2. Unzip the downloaded compressed package to a directory without a Chinese path
- 3. Configure MySQL environment variables
- 4. Verify whether the configuration is successful
- 5. Initialize the MySQL database
- 6. Register MySQL service
- 7. Start the MySQL service
- 8. Modify the MySQL database default account password
- 9. Log in to the MySQL database
- 10. Exit MySQL
- Two, MySQL uninstall
1. MySQL installation
1. Download the MySQL compressed package
- Official website download address: https://dev.mysql.com/downloads/mysql/
2. Unzip the downloaded compressed package to a directory without a Chinese path
3. Configure MySQL environment variables
-
This Computer→Properties→Advanced System Settings→Environment Variables
-
New→Variable name: MYSQL_HOME→Variable value: Decompression directory of MySQL compressed package→OK
-
Path→New→%MYSQL_HOME%\bin→OK→OK→OK
4. Verify whether the configuration is successful
-
Run command prompt as administrator
-
Enter
mysql
Enter → appearCan't connect to MySQL server on 'localhost
to prove that the addition is successful
5. Initialize the MySQL database
#执行如下命令初始化数据库
mysqld --initialize-insecure
初始化完成后,MySQL解压目录下会生成一个data目录,data目录里面存放的就是MySQL的数据
6. Register MySQL service
mysqld -install
计算机上已经安装好了MySQL服务了
7. Start the MySQL service
//启动mysql服务
net start mysql
//停止mysql服务
net stop mysql
8. Modify the MySQL database default account password
mysqladmin -u root password root
这里的 root 就是指默认管理员(即root账户)的密码,可以根据自己进行修改。
9. Log in to the MySQL database
mysql -uroot -proot
左下角为 mysql> ,则登录成功。
10. Exit MySQL
exit
quit
Two, MySQL uninstall
1. Run Command Prompt as administrator
2. Stop the MySQL service
net stop mysql
3. Uninstall the MySQL service
mysqld -remove mysql