windows install mysql 5.7


This time I use the decompressed version.

I decompress it and put it directly on the C drive

1. Add the environment variable path: C:\MySQL-5.7.13\bin;

2. Find the mysql installation directory, copy my-default.ini and rename it to Add
   basedir=C:\MySQL-5.7.13 in my.ini (the directory where mysql is located)
   datadir=C:\MySQL-5.7.13\data (create one without a data directory)
3. Run cmd Note here, Before mysql5.7 was installed by default, root had no password. After 5.7, a random password was generated. I didn't find this file under Windows, so I could only use

mysqld --initialize-insecure, which does not generate a password during installation. This The command will generate a root user without password

mysqld -install Automatically generate a root user with a random password

Start the mysql service

net start mysql

user login
mysql -u root -p

Change the root password

There is no password in the user table of the mysql database after 5.7.9 The field is changed to authentication_string, so use

update mysql.user set authentication_string=PASSWORD('password') where user='root';

If you are unclear, you can use select * from mysql.user to view the fields of this table,

refresh privileges

, flush privileges; you need a password to log

out of

quit and log in again.









Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326802683&siteId=291194637