phpstudy switches mysql version

藏色散人
Release: 2019-08-29 10:23:13
Original
11625 people have browsed it

phpstudy switches mysql version

phpstudy switch mysql version

1. Download the new version of mysql

For example, mysql5.7: https://dev.mysql.com/downloads/file/?id=467269

2. Back up phpStudy\PHPTutorial\MySQL

3. Unzip the downloaded new version mysql, place it in phpStudy\PHPTutorial\, and rename it to MySQL

4. Copy a copy of my-default.ini and rename it to my.ini

5. Modify the my.ini configuration

basedir = D:/phpStudy/PHPTutorial/MySQL
datadir = D:/phpStudy/PHPTutorial/MySQL/data
skip-grant-tables
Copy after login

Note: Change it according to your actual path situation. If you have configuration changes, you can add them yourself if you don’t have them. Just add them under [mysqld]

6. In Enter the MySQL bin directory under cmd (mine is D:/phpStudy/PHPTutorial/MySQL/bin) and execute the initialization command

mysqld --initialize
Copy after login

Note 1: If TIMESTAMP with implicit DEFAULT value is reported. Please use -- explicit_defaults_for_timestamp server option (see documentation for more details). If there is an error, modify the my.ini configuration and add

explicit_defaults_for_timestamp = true
Copy after login

under [mysqld]. Note 2: If 'NO_ZERO_DATE', 'NO_ZERO_IN_DATE' and 'ERROR_FOR_DIVISION_BY_ZERO' sql is reported modes should be used with strict mode. They will be merged with strict mode in a future release. error, modify my.ini and add it under [mysqld] (direct modification of existing configuration)

sql_mode = NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER
Copy after login

七, Install and start the service

mysqld -install
net start MySQL
Copy after login

8. Modify the mysql login password

mysql -uroot -p
Copy after login

PS: No need to enter the password, just press Enter

update mysql.user set authentication_string=password('root') where user='root' and Host ='localhost';
Copy after login

Note: 'root' is just an example , change it to the password you want

Refresh permissions

FLUSH PRIVILEGES;
Copy after login

9. Modify my.ini and comment out skip-grant-tables

# skip-grant-tables
Copy after login

Restartmysql

net stop MySQL
net start MySQL
Copy after login

For more phpstudy related technical articles, please visit the phpstudy usage tutorial column to learn!

The above is the detailed content of phpstudy switches mysql version. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template