当前位置:网站首页>MariaDB database upgrade version
MariaDB database upgrade version
2022-07-24 00:27:00 【May the waves make the end of the world】
1) Install old version database ( If installed , You can skip )
[[email protected] ~]# wget https://dlm.mariadb.com/1657824/MariaDB/mariadb-10.4.19/bintar-linux-x86_64/mariadb-10.4.19-linux-x86_64.tar.gz
[[email protected] ~]# tar xf mariadb-10.4.19-linux-x86_64.tar.gz
[[email protected] ~]# mv mariadb-10.4.19-linux-x86_64 /usr/local/mariadb
[[email protected] ~]# cd /usr/local/mariadb
[[email protected] mariadb]# useradd -s /sbin/nologin mysql -M
[[email protected] mariadb]# sed -i 's#^basedir=#basedir=/usr/local/mariadb#' support-files/mysql.server
[[email protected] mariadb]# sed -i 's#^datadir=#datadir=/usr/local/mariadb/data#' support-files/mysql.server
[[email protected] mariadb]# ./scripts/mysql_install_db --basedir=/usr/local/mariadb --datadir=/usr/local/mariadb/data --user=mysql
[[email protected] mariadb]# cat <<END > my.cnf
[mysqld]
port=3306
skip-name-resolve
max_connections=20000
server-id=1
log-bin=mysql-bin
expire_logs_days=14
binlog_format=ROW
END
[[email protected] mariadb]# rm -rf /etc/my.cnf
[[email protected] mariadb]# chown -R mysql:mysql .
[[email protected] mariadb]# ./support-files/mysql.server start

2) Prepare a new version of the database , And back up the old database directory
[[email protected] ~]# wget https://dlm.mariadb.com/2258065/MariaDB/mariadb-10.4.25/bintar-linux-x86_64/mariadb-10.4.25-linux-x86_64.tar.gz
[[email protected] ~]# tar xf mariadb-10.4.25-linux-x86_64.tar.gz
[[email protected] ~]# /usr/local/mariadb/support-files/mysql.server stop # Close the database
[[email protected] ~]# nohup cp -r /usr/local/mariadb /usr/local/mariadb-$(date +%F) &
- When backing up above , You need to wait for the database process to exit completely , Backup in progress ( Because the database process that has not exited may also cause data generation )
3) upgrade
In fact, upgrade the database , You only need to convert the old version of the database data Put the directory under the directory of the new version database . Next we will work with data Remove directories unrelated to directories , It's because of dang data When the directory is large , It will be slow to move , So by moving other directories , To shorten the time required for upgrading .
[[email protected] ~]# cd /usr/local/mariadb
[[email protected] mariadb]# mkdir backup
[[email protected] mariadb]# ls | egrep -v 'backup|data|my.cnf' > /root/1.txt
[[email protected] mariadb]# for i in $(cat /root/1.txt);do mv $i backup/;done
[[email protected] mariadb]# rm -rf /root/mariadb-10.4.25-linux-x86_64/data # What is deleted here is in the new package data Catalog
[[email protected] mariadb]# cp -r /root/mariadb-10.4.25-linux-x86_64/* .
[[email protected] mariadb]# chown -R mysql:mysql .
[[email protected] mariadb]# sed -i 's#^basedir=#basedir=/usr/local/mariadb#' support-files/mysql.server
[[email protected] mariadb]# sed -i 's#^datadir=#datadir=/usr/local/mariadb/data#' support-files/mysql.server
[[email protected] mariadb]# ./support-files/mysql.server start
[[email protected] mariadb]# ./bin/mysql_upgrade -uroot --force
verification :
[[email protected] mariadb]# /usr/local/mariadb/bin/mysql -V

Possible problems in the upgrade process :
1) Output :
...
ERROR 1932 (42S02): at line 603: Table 'mysql.innodb_table_stats' doesn't exist in engine
FATAL ERROR: Upgrade failed
The error reported above is because the table in the database is damaged , Delete the damaged table in the database , Upgrade again
MariaDB [(none)]> drop table mysql.innodb_table_stats;
Query OK, 0 rows affected (0.001 sec)
[[email protected] mariadb]# rm -rf /usr/local/mariadb/data/mysql/innodb_table_stats.ibd
2) Output :
Error: Server version (10.4.19-MariaDB-log) does not match with the version of
the server (10.4.25-MariaDB) with which this program was built/distributed. You can
use --skip-version-check to skip this check.
FATAL ERROR: Upgrade failed
- The above error is reported because we have replaced the binary package , It is caused by not restarting the database , Can pass
--skip-version-checkTo skip the check .
[[email protected] ~]# /usr/local/mariadb/bin/mysql_upgrade -uroot --skip-version-check
边栏推荐
- Educational Codeforces Round 132 (Rated for Div. 2)(A-D)
- AWS Part 4 one machine and one secret
- Customize an object
- 分布式之 CAP 原则
- CA digital certificate
- 二叉搜索树的简易实现及剖析
- MySQL table field quantity limit and row size limit
- July 23, 2022 - mapper file description
- C language book recommendation
- Detailed explanation of data warehouse standard -2022
猜你喜欢

The prediction of domestic AI protein structure reproduced a breakthrough and solved the 3D structure with a single sequence. Peng Jian's team: "the last piece of puzzle since alphafold2 has been comp
![[wechat applet] design and interactive implementation of auction product details page (including countdown and real-time update of bids)](/img/b5/dd4316b83ef4b80c36b532de658bb2.png)
[wechat applet] design and interactive implementation of auction product details page (including countdown and real-time update of bids)

Flutter | specifies the type of page return value

Problem note - unable to open include file: "direct.h": no such file or directory

Customize an object

Inode, soft link, hard link

Overview of data model design method

English语法_指示代词 - So

Docker builds sonarqube, mysql5.7 environment

Classic example of C language - loan balance
随机推荐
Summary of pit websocket
GBase 8c 访问权限查询函数(二)
High number_ Chapter 1 space analytic geometry and vector algebra__ Two point distance
CA digital certificate
Difference between data index and label system of data warehouse
Pytest interface automation test framework | control test case execution
[speech synthesis] tensorflowtts Chinese text to speech
High number_ Chapter 2 differential calculus of multivariate functions__ Geometric application of partial derivatives_ Tangent and normal plane of space curve
PayPal subscription process and API request
Blockbuster | certik: Web3.0 industry safety report release in the second quarter of 2022 (PDF download link attached)
Gbase 8C session information function (4)
The universal esp32c3 configures partition tables based on the Arduino ide framework
Pipeline pipeline project is built by declarative and jenkinsfile under Jenkins
Robot dog back submachine gun shooting video fire, netizens shivering: stoooooooopppp!
Redis数据结构
Codeforces Round #807 (Div. 2)(A-D)
Flutter | specifies the type of page return value
Table custom table encapsulation
Gbase 8C system table information function (II)
How to open a low commission account? Is it safe?