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 @   花儿笑弯了腰  阅读(700)  评论(0编辑  收藏  举报
编辑推荐:
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
阅读排行:
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· .NET周刊【3月第1期 2025-03-02】
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· [AI/GPT/综述] AI Agent的设计模式综述
点击右上角即可分享
微信分享提示