How to install and run mysql5.7: first unzip the installation package to a certain directory, and initialize the database; then set a root random password, and start the mysqld service; then log in to Mysql and reset the root password; finally Install windows service and set remote access permissions.
More related free learning recommendation: mysql tutorial (video)
mysql5.7 How to install and run:
1. Unzip to a certain directory, such as: D:\tools\mysql-5.7.11-winx64
2.mysql5. Version 7 compressed package, there is no data folder by default, you need to initialize the database first, the command is as follows:
D:\tools\mysql-5.7.11-winx64\ bin> mysqld --initialize
3. After initialization, a data folder will be generated under the mysql-5.7.11-winx64
folder. The root password of the mysql5.7 version is disabled by default. It is empty, but a random password.
The password can be viewed in the “machine name.err” file under the data folder. The content is as follows:
2016-02-26T03:23:56.025673Z 1 [Note] A temporary password is generated for root@localhost: yai/UnHse8Nu
4. Start mysqld service
D:\tools\mysql-5.7.11-winx64\bin> mysqld --console
5. Use the random password to log in to mysql, command As follows:
D:\tools\mysql-5.7.11-winx64\bin> mysql -uroot -pyai/UnHse8Nu
6 .After logging in, you need to reset the root password before you can use the database. The command is as follows:
mysql> ALTER USER 'root'@& #39;localhost' IDENTIFIED BY 'new_password';
7. Install as windows service
Installation: D:\tools\mysql-5.7.11 -winx64\bin> mysqld –install
Uninstall: D:\tools\mysql-5.7.11-winx64\bin> mysqld –remove
8. Set remote access permissions
mysql> grant all PRIVILEGES on *.* to root@'%' identified by 'your_passwd'; mysql> flush privileges;
The above is the detailed content of how to install and run mysql5.7, please pay attention to other related articles on 1024programmer.com for more information!