<tfoot id='jvcR8'></tfoot>
  1. <legend id='jvcR8'><style id='jvcR8'><dir id='jvcR8'><q id='jvcR8'></q></dir></style></legend>

        <bdo id='jvcR8'></bdo><ul id='jvcR8'></ul>

      <small id='jvcR8'></small><noframes id='jvcR8'>

    1. <i id='jvcR8'><tr id='jvcR8'><dt id='jvcR8'><q id='jvcR8'><span id='jvcR8'><b id='jvcR8'><form id='jvcR8'><ins id='jvcR8'></ins><ul id='jvcR8'></ul><sub id='jvcR8'></sub></form><legend id='jvcR8'></legend><bdo id='jvcR8'><pre id='jvcR8'><center id='jvcR8'></center></pre></bdo></b><th id='jvcR8'></th></span></q></dt></tr></i><div id='jvcR8'><tfoot id='jvcR8'></tfoot><dl id='jvcR8'><fieldset id='jvcR8'></fieldset></dl></div>

    2. 更新后恢复 MySQL/var/lib/mysql

      时间:2023-06-06
        <tbody id='rw2Nr'></tbody>
      <tfoot id='rw2Nr'></tfoot>

      <small id='rw2Nr'></small><noframes id='rw2Nr'>

        <i id='rw2Nr'><tr id='rw2Nr'><dt id='rw2Nr'><q id='rw2Nr'><span id='rw2Nr'><b id='rw2Nr'><form id='rw2Nr'><ins id='rw2Nr'></ins><ul id='rw2Nr'></ul><sub id='rw2Nr'></sub></form><legend id='rw2Nr'></legend><bdo id='rw2Nr'><pre id='rw2Nr'><center id='rw2Nr'></center></pre></bdo></b><th id='rw2Nr'></th></span></q></dt></tr></i><div id='rw2Nr'><tfoot id='rw2Nr'></tfoot><dl id='rw2Nr'><fieldset id='rw2Nr'></fieldset></dl></div>

            <bdo id='rw2Nr'></bdo><ul id='rw2Nr'></ul>
          • <legend id='rw2Nr'><style id='rw2Nr'><dir id='rw2Nr'><q id='rw2Nr'></q></dir></style></legend>

              • 本文介绍了更新后恢复 MySQL/var/lib/mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                限时送ChatGPT账号..

                我在 Centos 6 服务器中从 Mysql 5.5 更新到 8.0,没有将数据库转储到 .sql 文件,我只是将/var/lib/mysql 目录复制到另一个位置.

                I did an update from Mysql 5.5 to 8.0 in a Centos 6 server without dumping the databases to a .sql file, I just copied the /var/lib/mysql directory to another location.

                现在,如果我尝试加载 mysqld 服务,它会崩溃.

                Now if I try to load mysqld service it crashes.

                天真我删除了/var/lib/mysql的所有内容并重新安装了该服务,现在它可以运行但现在我不知道如何手动将数据库文件导入目录(复制并粘贴文件夹不起作用)以检查数据库和/或修复它.

                Being naive I deleted all the content of /var/lib/mysql and installed the service again, now it runs but now I do not know how to manually import the DB files to the directory (copy & paste of the folder does not work) in order to do a check of the DB and/or repair it.

                推荐答案

                rysnc 应该可能已经安装,但如果没有,你会:

                rysnc should likely already be installed, but if it isn't you would:

                sudo yum install rsync

                然后

                #make sure mysql isn't running
                sudo service mysqld stop
                
                #double check that there is no MySQL PID running
                sudo ps aux | grep mysql
                
                #move the new MySQL 8.0 data files out of the way
                sudo mv /var/lib/mysql /var/lib/mysql.bak
                
                #copy the original data files back to /var/lib/mysql
                #note that the trailing / is required for both paths
                sudo rsync -av /path/to/original/mysql/db/files/ /var/lib/mysql/
                
                #change user and group ownership to mysql
                sudo chown -R mysql:mysql /var/lib/mysql
                
                #start MySQL
                sudo service mysqld start
                
                #run mysql_upgrade, replace {usernamehere} with the actual username
                sudo mysql_upgrade -u {usernamehere} -p
                

                更新:

                您需要将二进制文件降级到 5.5.一旦 MySQL 再次运行,请备份每个数据库,然后按以下顺序升级:

                You will need to downgrade the binaries to 5.5. Take a backup of each database once MySQL is running again and then upgrade in the following order:

                • 5.6
                • 5.7
                • 8.0

                您需要在每次升级后运行 mysql_upgrade.

                You will need to run mysql_upgrade after each upgrade.

                这篇关于更新后恢复 MySQL/var/lib/mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:编写 mysql 查询的想法 下一篇:WooCommerce 按产品元查询订单项

                相关文章

                最新文章

                <i id='frrYm'><tr id='frrYm'><dt id='frrYm'><q id='frrYm'><span id='frrYm'><b id='frrYm'><form id='frrYm'><ins id='frrYm'></ins><ul id='frrYm'></ul><sub id='frrYm'></sub></form><legend id='frrYm'></legend><bdo id='frrYm'><pre id='frrYm'><center id='frrYm'></center></pre></bdo></b><th id='frrYm'></th></span></q></dt></tr></i><div id='frrYm'><tfoot id='frrYm'></tfoot><dl id='frrYm'><fieldset id='frrYm'></fieldset></dl></div>
                <legend id='frrYm'><style id='frrYm'><dir id='frrYm'><q id='frrYm'></q></dir></style></legend>

                • <bdo id='frrYm'></bdo><ul id='frrYm'></ul>

                <tfoot id='frrYm'></tfoot>

              • <small id='frrYm'></small><noframes id='frrYm'>