Home > Database > Mysql Tutorial > body text

The process and problem solving of replacing MySQL 5.7.03 to MySQL 5.7.17

黄舟
Release: 2017-08-23 13:37:54
Original
1342 people have browsed it

This article mainly introduces the installation process of replacing the higher version of MySQL5.7.03 to MySQL 5.7.17 and the solutions to the problems found. Friends in need can refer to the following

1. How to install ?

1. [Run]->[cmd] Open a small black window. Navigate to the bin directory of the MySQL installation directory [my D:\Program Files\mysql-5.7.9-winx64] and enter [mysqld -install]. As shown in the picture below, the installation is successful

2. Open the MySQL installation directory, find [my-default.ini], and configure some simple information.


# These are commonly set, remove the # and set as required. 
basedir = D:\Program Files\mysql-5.7.9-winx64 
datadir = D:\Program Files\mysql-5.7.9-winx64\data 
port = 3306 
# server_id = .....
Copy after login

3. Enter [mysqld --initialize] to initialize mysql. The initialization process may take a while. When the following interface appears and there is content in the data folder in the MySQL installation directory, it indicates successful initialization.

Because the new version of MySQL needs to initialize a write table when it starts. Therefore, please do not skip this step.

4. Enter [mysqld -install] to install the MySQL service.

5. Start mysql [net start mysql]

6. Log in [mysql -uroot -p]

Installation-free version of msyql-5.7.17-winx64.zip , a data directory will be generated during initialization in step 3. The default root account initial password is in the .err file in the mysql-5.7.17\data directory

7. After successful login, change the root account password to ' root'


#
 修改root账户的密码ALTER
 USER 'root'@'localhost'
 IDENTIFIED BY'root';
Copy after login

2. How to restore a lower version of the sql database:

1 Change the data directory First cut the ibdata1 under the previous low version to other places

2 Copy the users (here is a users library as an example) folder and ibdata1 file in the previous low version of the data directory to the data directory of the high version of mysql .

At this time, the copied users library can be used, but the database in the higher version cannot be used (because the ibdata1 file is a lower version)

3 Restart mysql and save the users library as . sql file

4 Replace the low version ibdata1 file with the high version ibdata1 (now, the high version library can be used, the low version library cannot be used, ibdata1 is a high version)

5 Restart msyql, create a library (users, the library name can be changed), open the .sql file generated in step 3 in MySQL Workbench and execute

Summary

The above is the detailed content of The process and problem solving of replacing MySQL 5.7.03 to MySQL 5.7.17. 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