As mariadb5.x does not support time function and other functions, it is necessary to upgrade the original database version

Database Upgrade

The upgrade involves two steps: 1. The original database backup - [mysqldump command backup] (https://www.cnblogs.com/kissdodog/p/4174421.html) - or through a backup database storage file directory (yum install mariadb path in /var/lib/mysql) 2. The database stops services, uninstalls the original version, and deletes legacy data. Yum then installs the new versionCopy the code

Database Recovery

If you are using a backup database to store files and directories, then you are ready to start the journey

  • The new database version is incompatible with the original database. The new database version has tablename. FRM and tablename.ibd.
  • /var/lib/mysql/ibdata/db.opt /.frm/db.opt /.frm /var/lib/mysql/ibdata
  • Therefore, data recovery is to restore all databases, not a single database. = = = =
1. First find a new server and build mariadb with the same version as the original database 2. Stop the mysql service: systemctl stop mariadb 3. Replace the /var/lib/mysql file with the /var/lib/mysql file 4. Set the mysql/etc/my. CNF. D/server. In the conf/mysqld innodb_force_recovery = 6, 5. Start mysql systemctl start mariadbCopy the code

Possible errors

Run the systemctl status mariadb log command to check the vim /var/lib/mysql.err file

ERROR: mysqld: Can't find file: './ Mysql /host. FRM '(errno: 13) [ERROR] Fatal ERROR: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: Mysql_install_db chown -r mysql:mysql./*Copy the code

References:

Cnzhx.net/blog/restor… Blog.csdn.net/lihuarongai… Blog.csdn.net/weixin_3173…

Conclusion:

Took some detours in the middle, still want to see more log. Haha, there will be more potholes ahead after crossing this pothole