Install mysql 8.0 on Windows 10 | mysql 8.0 installation tutorial

1. Download the mysql installation file suitable for your own operating system, unzip it and use it directly

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

2. Unzip the compressed package, the directory structure is as follows. There is no my.ini file and data folder in the compressed package after decompression, my.ini can be manually created by yourself, but the data folder must not be manually created

3. Create a new my.ini file and add the simplest configuration, as follows:

[mysqld]
port=3036
basedir=D:\download\mysql-8.0.33-winx64
datadir=D:\download\mysql-8.0.33-winx64\data\

4. Configure the mysql environment variable, that is, add the mysql bin directory to the path: D:\download\mysql-8.0.33-winx64\bin

5. Test whether the mysql environment variable is configured successfully

 If no error is reported, it means success.

6. Use the following command to initialize mysql, cmd needs to be run as an administrator, remember! ! ! !

mysqld --initialize --console

The effect after execution is as follows, it will automatically create the data directory, and set a password for the root user, and print it out on the console. Remember this password. If you don’t remember it, you can only re-execute the above command

7. Here we can execute the following command to start mysql

net start mysql

8. Change the root password to something you can remember

登录:mysql -u root -p
修改密码: alter user 'root'@'localhost' identified with mysql_native_password by '123456';

9. Create your own databases

mysql installation is complete.

Guess you like

Origin blog.csdn.net/u011207400/article/details/130334197