How to install and run mysql5.7

coldplay.xixi
Release: 2020-11-13 10:17:46
Original
6049 people have browsed it

How to install and run mysql5.7: First, unzip the installation package to a directory and initialize the database; then set a random root password and start the mysqld service; then log in to Mysql and reset the root password; finally Install the windows service and set remote access permissions.

How to install and run mysql5.7

More related free learning recommendations:mysql tutorial(video)

mysql5.7 installation and running method:

1. Unzip to a directory, such as: D:\tools\mysql-5.7.11-winx64

2.mysql5 .7 version 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
Copy after login

3. After initialization, it will be in themysql-5.7.11-winx64folder Generate a data folder. The root password of the mysql5.7 version is not empty by default, but a random password.

This 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
Copy after login

4. Start the mysqld service

D:\tools\mysql-5.7.11-winx64\bin> mysqld --console
Copy after login

5. Use the random password to log in to mysql. The command is as follows:

D:\tools\mysql-5.7.11-winx64\bin> mysql -uroot -pyai/UnHse8Nu
Copy after login

6. After logging in, you need to reset the root password. To use the database, the command is as follows:

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'new_password';
Copy after login

7. Install as a 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;
Copy after login

The above is the detailed content of How to install and run mysql5.7. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!