content_image/671407.jpg content_image/671408.jpg
To perform a logical upgrade: 

1. Review the information in Section 2.11.1, “Before You Begin” . 

2. Export your existing data from the previous MySQL installation: 

mysqldump -u root -p --add-drop-table --routines --events --all-databases --force > data-for-upgrade.sql 

<img src='content_image/671407.jpg'>

<img src='content_image/671408.jpg'>

3. Shut down the old MySQL server. For example: 

mysqladmin -u root -p shutdown 

deprecated, or removed features and capabilities. Consequently, SQL extracted from a previous MySQL release may require modification to enable a logical upgrade. 

To identify incompatibilities before upgrading to the latest MySQL 8.0 release, perform the steps described in Section 2.11.5, “Preparing Your Installation for Upgrade” . 

## Note 

Use the --routines  and --events  options with mysqldump  (as shown above) if your databases include stored programs. The --all-databases option includes all databases in the dump, including the mysql  database that holds the system tables. 

## Important 

If you have tables that contain generated columns, use the mysqldump utility provided with MySQL 5.7.9 or higher to create your dump files. The mysqldump  utility provided in earlier releases uses incorrect syntax for generated column definitions (Bug #20769542). You can use the INFORMATION_SCHEMA.COLUMNS  table to identify tables with generated columns. 

4. Install MySQL 8.0. For installation instructions, see Chapter 2, Installing and Upgrading MySQL . 

5. Initialize a new data directory, as described in Section 2.10.1, “Initializing the Data Directory” . For example: 

mysqld --initialize --datadir= /path/to/8.0-datadir 

Copy the temporary ’root’@’localhost’  password displayed to your screen or written to your error log for later use. 

6. Start the MySQL 8.0 server, using the new data directory. For example: 

mysqld_safe --user=mysql --datadir= /path/to/8.0-datadir  & 

7. Reset the root  password: 

shell> mysql -u root -p Enter password: **** <- enter temporary root password mysql> ALTER USER USER() IDENTIFIED BY ’ your new password ’; 

