CentOS系统虽然稳定,但是自带的好多软件真的有点旧,幸好现在有好多可信赖的第三方或者软件官方提供yum repo,这样我们升级方便多了。刚把Centos7.6里的Mariadb5.5升级到了10.3版本,步骤如下:
[root@test ~]# systemctl stop mariadb #停止mariadb [root@test ~]# curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | bash #安装mariadb官方repo [root@test ~]# yum update MariaDB-server MariaDB-client #更新Mariadb [root@test ~]# systemctl start mariadb #启动Mariadb error solve ...... [ERROR] Incorrect definition of table mysql.event: expected column ...... 2019-04-19 15:56:33 0 [ERROR] mysqld: Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler ......
更新完毕后,想当然的直接启动mariadb了,但是5.5到10.3版本还是有较大变化的,比如默认数据库表结构都有了改变,因此直接报错无法启动,所以得先执行一下upgrade,然后再启动就OK了:
[root@test ~]# mysql_upgrade -uroot -p [root@test ~]# systemctl restart mariadb