Fork me on GitHub

Percona Server 升级 5.7 到 8.0 版本

今天发现 Percona Server 已经发布了 8.0 的版本,于是把服务端的 MYSQL 的版本升级了下;备份好数据,升级按照官方的文档来

$ percona-release enable ps-80 release
$ apt-get update
$ apt-get install percona-server-server

$ mysql_upgrade

Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.engine_cost                                  OK
...
Upgrade process completed successfully.
Checking if update is needed.

$ service mysql restart

问题:

ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist
# 解决方法
 mysql_upgrade -u root -p;
mysql> show databases;
ERROR 1449 (HY000): The user specified as a definer ('mysql.infoschema'@'localhost') does not exist
mysql> ^C^Z
[2]+  Stopped                 mysql -uroot -p
root@iZbp1gf15gbzzqwvxbj18jZ:~# mysql_upgrade -u root -p;
Enter password: 
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Upgrading system table data.
Checking system database.
mysql.columns_priv                                 OK
mysql.component                                    OK
mysql.db                                           OK
mysql.default_roles                                OK
mysql.engine_cost                                  OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.global_grants                                OK
mysql.gtid_executed                                OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.ndb_binlog_index                             OK
mysql.password_history                             OK
mysql.plugin                                       OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.role_edges                                   OK
mysql.server_cost                                  OK
mysql.servers                                      OK
mysql.slave_master_info                            OK
mysql.slave_relay_log_info                         OK
mysql.slave_worker_info                            OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
Found outdated sys schema version 1.5.1.
Upgrading the sys schema.
Checking databases.
Upgrade process completed successfully.
Checking if update is needed.

 

# Reference Documentation

* https://github.com/percona/percona-server
* https://www.percona.com/mysql/software/percona-server-for-mysql
* https://docs.percona.com/percona-server/8.0/quickstart-overview.html

## 安装 percona-server

```shell
    sudo yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm
    sudo percona-release setup ps-80
    sudo yum install percona-server-server
```

## 查看 mysql 服务

```shell
    systemctl enable mysqld.service
    systemctl restart mysqld.service (或 service mysql restart)
    systemctl status mysqld.service

```

## 默认目录(8.0 默认 utf8mb4 编码)

```text
    /etc/my.cnf
    /var/lib/mysql
    /var/log/mysqld.log
```

## 修改默认密码

```shell
    #查看mysql初始密码
    grep 'temporary password' /var/log/mysqld.log
    mysql -uroot -p
    ALTER USER 'root'@'localhost' IDENTIFIED BY 'NEW_USER_PASSWORD';
    
    #开启远程连接
    use mysql; 
    mysql> update user set host = '%' where user = 'root'; 
    mysql> select host, user from user;
```

 

REFER:
https://www.percona.com/doc/percona-server/LATEST/upgrading_guide.html
https://stackoverflow.com/questions/10169960/mysql-error-1449-the-user-specified-as-a-definer-does-not-exist

posted @ 2019-02-25 13:52  花儿笑弯了腰  阅读(682)  评论(0编辑  收藏  举报