This article mainly introduces the method steps of upgrading MySQL version in Phpstudy, the article introduces the example code in very detailed, to everyone's study or work has a certain reference learning value, the need for friends to see together below.
Objective
I found a mistake at work today and always error when I go to the local data sheet:
[ERR] 1294-invalid on UPDATE clause for ' Field name ' column
Data table field for error:
' Field name ' DateTime DEFAULT NULL on UPDATE current_timestamp
Colleagues say the same SQL file can lead to success. Guess the database version of the problem, the colleague is 5.6, I checked the local database version is 5.5.53. Online check, sure enough is the version of the problem, 5.5 and 5.6 in timestemp behavior is different, 5.6.5 previous version does not support multiple current_timestamp default values.
Since the local integration environment is Phpstudy 2016, there is no option to upgrade the MySQL version, so upgrade yourself.
Download the high version of MySQL from the official website:
Official website: https://dev.mysql.com/downloads/file/?id=467269
Baidu Cloud Disk Address: Https://pan.baidu.com/s/1mi4UHtA
The selected version is 5.7.17 (later found that the 5.7 version of the installation, the system table fields, etc. are different from the previous version).
Steps:
First, back up the original Phpstudy MySQL installation directory
Second, extract the downloaded MySQL compressed files to the MySQL directory under Phpstudy, copy the My-default.ini, and rename it to My.ini.
Open the My.ini and locate the editor at #basedir:
Basedir=d:/phpstudy/mysqldatadir=d:/phpstudy/mysql/data
Third, add the MySQL installation path to the system environment variable
Iv. Enter the MySQL bin directory under cmd (my is D:/phpstudy/mysql/bin), execute:
Mysqld--initialize
Initializing the database
Five, Installation Services:
Mysqld-install
Start the service:
net start MySQL
Six, log in MySQL error at this time:
C:\users\dell>mysql-uroot-penter Password: ****error 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using P Assword:yes)
Try to modify the root user password:
Open My.ini, find [mysqld], add below:
Skip-grant-tables
At this point, use the root account, enter the password at the login.
Change Password:
Mysql>update Mysql.user Set Authentication_string=password (' New_password ') where user= ' root ' and Host = ' localhost ' mysql> ALTER User User () identified by ' News_password ';
Refresh permissions:
FLUSH privileges;
Comment out the my.ini that you just added
Skip-grant-tables
Log in again.
View the MySQL version at this time:
Mysql> select version (); +-----------+| Version () |+-----------+| 5.7.17 |+-----------+
Related recommendations:
Walkthrough iOS Database Upgrade Data Migration
Record the steps of the company database Upgrade
Oracle 11g ASM Database Upgrade compatible