mysql8.0 installation tutorial and configuration (most detailed) simple operation

1. Download mysql8.0.26 (the latest version at present)

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

 2. No login, only download

 3. Unzip the compressed package to the directory where your usual software installation is stored

4. Configure environment variables after decompression

[This Computer]-[Right Click]-[Properties]-[Advanced System Settings]-[Environment Variables]-[Find the path in the system variable]-[Select]-[Edit]-[New]-[Compress MySQL just now] Click the package to enter the bin directory path, copy and paste it in]-[OK]

5. Create a new my.ini file and a Data folder in the mysql-8.0.26-winx64 directory [create my.txt first and then change the suffix to ini, the Data folder is to store mysql data]

 

6. Then copy the following text in the my.ini file, pay attention to modify the basedir and datadir to the location where you store it

[mysqld]
#设置3306端口
port=3306
#设置mysql的安装目录
basedir="D:\\softwareInstall\\mysql-8.0.26-winx64"
#设置mysql数据库的数据的存放目录
datadir="D:\\softwareInstall\\mysql-8.0.26-winx64\\data"
#允许最大连接数
max_connections=200
#允许连接失败的次数。
max_connect_errors=10
#服务端使用的字符集默认为utf8mb4
character-set-server=utf8mb4
#创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
#默认使用“mysql_native_password”插件认证
#mysql_native_password
default_authentication_plugin=mysql_native_password
[mysql]
#设置mysql客户端默认字符集
default-character-set=utf8mb4
[client]
#设置mysql客户端连接服务端时默认使用的端口
port=3306
default-character-set=utf8mb4

 7. Next, start the initialization, installation, start the database, and modify the initialization password.

8. Enter cmd and press Enter

9. Then enter mysqld --initialize --console

After execution, find A temporary password is generated for root@localhost: This sentence, localhost is followed by its own initialization password.

10. Next, install the service mysqld --install mysql80 (Note: mysql80 is the service name that you took by yourself, you can change it according to your own)

 11. Next start the service net start mysql80

12. Next, log in to mysql and change the password mysql -uroot -p

Temporary password (that is, the random password saved during the previous initialization)

13. Next, modify the password alter user 'root'@'localhost' identified by '123456'; 

14. The installation is successful here, we can test the connection through the mysql connection tool navicat 

 

 

15. Okay, this is the end. If you like the work, you can like, follow, and collect, thank you! 

Guess you like

Origin blog.csdn.net/weixin_51966461/article/details/120044626