• mariadb升级


    官方文档升级:https://mariadb.com/kb/en/library/upgrading/

    1.备份原来的数据库和配置文件

    # mysqldump -u root -p -A > alldb.sql 
    # cp /etc/my.cnf /etc/my.cnf.bak

    2.添加 MariaDB Yum仓库

    # vim /etc/yum.repos.d/MariaDB.repo
    [mariadb]
    name = MariaDB
    #baseurl = http://yum.mariadb.org/10.3/centos7-amd64
    #gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
    baseurl = http://mirrors.ustc.edu.cn/mariadb/yum/5.5/centos7-amd64/
    gpgkey=http://mirrors.ustc.edu.cn/mariadb/yum/RPM-GPG-KEY-MariaDB
    gpgcheck=1
    # 因为官方镜像下载很慢,所以可以替换为国内镜像

    3. 停止数据库运行

    # systemctl stop mariadb.service

    4. 卸载 MariaDB 老版本

    # yum remove mariadb mariadb-server

    5. 安装新的指定版本mariadb

    # sudo yum install MariaDB-server-5.5.64 MariaDB-client-5.5.64

    6. 修改配置文件my.cnf

    7. 启动MariaDB

    # systemctl start mysql

    8. 运行 mysql_upgrade升级数据库

    # mysql_upgrade -uroot -p
    Enter password: 
    Phase 1/4: Fixing views
    Phase 2/4: Fixing table and database names
    Phase 3/4: Checking and upgrading tables
    Processing databases
    information_schema
    mydb
    mydb.app02_author OK
    mydb.app02_book OK
    mydb.app02_book_authors OK
    mydb.app02_publisher OK
    mydb.django_migrations OK
    mysql
    mysql.columns_priv OK
    mysql.db OK
    mysql.event OK
    mysql.func OK
    mysql.help_category OK
    mysql.help_keyword OK
    mysql.help_relation OK
    mysql.help_topic OK
    mysql.host OK
    mysql.ndb_binlog_index OK
    mysql.plugin OK
    mysql.proc OK
    mysql.procs_priv OK
    mysql.proxies_priv OK
    mysql.servers 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
    performance_schema
    test
    test.authors OK
    test.book_m2m_author OK
    test.books OK
    test.stu_to_tea OK
    test.students OK
    test.teachers OK
    zabbix
    zabbix.acknowledges OK
    zabbix.actions OK
    ...
    zabbix.widget_field OK
    Phase 4/4: Running 'mysql_fix_privilege_tables'
    OK

    9. 检查数据库

    # mysql -V 
    mysql  Ver 15.1 Distrib 5.5.65-MariaDB, for Linux (x86_64) using readline 5.1  #查看版本升级成功
    # cd /var/lib/mysql  # 查看mysql日志和数据库的数据
  • 相关阅读:
    当 LAST_INSERT_ID() 带有参数时# 清空重来
    同时多次插入时
    插入失败时
    编译生成动态库
    编译生成可执行文件
    添加一个静态JAVA库
    添加一个预编译应用程序
    编译一个需要用特定key前面的应用程序
    自定义ItemDecoration设置分割线
    linux常见命令
  • 原文地址:https://www.cnblogs.com/xiaobaozi-95/p/11685633.html
Copyright © 2020-2023  润新知