Home Database Mysql Tutorial 使用mysqlhotcopy 物理增量备份

使用mysqlhotcopy 物理增量备份

Jun 07, 2016 pm 05:21 PM
mysql

我们只需要使用ldconfig 指定路径即可,下面安装MySQL-shared-compat-5.0.95-1.glibc23.x86_64.rpm包则可跳过#ldconfig /usr/loc

MySQL版本是5.1.49

# uname -a
Linux loDB192168000046 2.6.18-238.19.1.el5 #1 SMP Fri Jul 15 07:31:24 EDT 2011 x86_64 x86_64 x86_64 GNU/Linux

# cat /etc/issue
CentOS release 5.6 (Final)
Kernel \r on an \m

# mysqlhotcopy -u root -p '密码' 数据库名 备份目录

Can't locate DBI.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at bin/mysqlhotcopy line 8.
BEGIN failed--compilation aborted at bin/mysqlhotcopy line 8.

上面出错是因为perl-DBD-mysql未安装:

# rpm -qa | grep perl-DBD

下载并安装perl-DBD-mysql提示缺少"libmysqlclient.so.15":
# rpm -ivh perl-DBD-MySQL-3.0007-2.el5.x86_64.rpm
error: Failed dependencies:
        libmysqlclient.so.15()(64bit) is needed by perl-DBD-MySQL-3.0007-2.el5.x86_64
        libmysqlclient.so.15(libmysqlclient_15)(64bit) is needed by perl-DBD-MySQL-3.0007-2.el5.x86_64
        perl(DBI) is needed by perl-DBD-MySQL-3.0007-2.el5.x86_64

看看 libmysqlclient.so.15这个文件是否存在
# locate libmysqlclient.so.15
/usr/local/mysql/lib/mysql/libmysqlclient.so.15
/usr/local/mysql/lib/mysql/libmysqlclient.so.15.0.0
结果显示libmysqlclient.so.15文件是有的, 只是不在/usr/lib目录下而已:

我们只需要使用ldconfig 指定路径即可,下面安装MySQL-shared-compat-5.0.95-1.glibc23.x86_64.rpm包则可跳过
#ldconfig /usr/local/mysql/lib/mysql

因为我的版本是5.1.49, 其实是有libmysqlclient的,但版本为locate libmysqlclient.so.16
# locate libmysqlclient.so.16
/usr/local/mysql-5.1.49-linux-x86_64-glibc23/lib/libmysqlclient.so.16
/usr/local/mysql-5.1.49-linux-x86_64-glibc23/lib/libmysqlclient.so.16.0.0
那我们使用MySQL-shared-compat 的rpm包:


下载MySQL-shared库文件, 下载地址:
先查包里面是否有libmysqlclient.so.15这个文件
# rpm -qilp MySQL-shared-compat-5.0.95-1.glibc23.x86_64.rpm
...
/usr/lib64/libmysqlclient.so
/usr/lib64/libmysqlclient.so.12
/usr/lib64/libmysqlclient.so.12.0.0
/usr/lib64/libmysqlclient.so.14
/usr/lib64/libmysqlclient.so.14.0.0
/usr/lib64/libmysqlclient.so.15
/usr/lib64/libmysqlclient.so.15.0.0
/usr/lib64/libmysqlclient_r.so
/usr/lib64/libmysqlclient_r.so.12
/usr/lib64/libmysqlclient_r.so.12.0.0
/usr/lib64/libmysqlclient_r.so.14
/usr/lib64/libmysqlclient_r.so.14.0.0
/usr/lib64/libmysqlclient_r.so.15
/usr/lib64/libmysqlclient_r.so.15.0.0
/usr/lib64/libndbclient.so
/usr/lib64/libndbclient.so.2
/usr/lib64/libndbclient.so.2.0.0
从执行结果上看是有的,,安装此rpm包 可以彻底解决关于类似 libmysqlclient.so 的问题。
# rpm -ihv MySQL-shared-compat-5.0.95-1.glibc23.x86_64.rpm

更新一下文件树库, 然后此时就会看到libmysqlclient.so.15在/usr/lib64目录下也有一份:
# updatedb
# locate libmysqlclient.so.15
/usr/lib64/libmysqlclient.so.15
/usr/lib64/libmysqlclient.so.15.0.0

linux

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
1 months ago By 尊渡假赌尊渡假赌尊渡假赌
Two Point Museum: All Exhibits And Where To Find Them
1 months ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP's big data structure processing skills PHP's big data structure processing skills May 08, 2024 am 10:24 AM

Big data structure processing skills: Chunking: Break down the data set and process it in chunks to reduce memory consumption. Generator: Generate data items one by one without loading the entire data set, suitable for unlimited data sets. Streaming: Read files or query results line by line, suitable for large files or remote data. External storage: For very large data sets, store the data in a database or NoSQL.

How to use MySQL backup and restore in PHP? How to use MySQL backup and restore in PHP? Jun 03, 2024 pm 12:19 PM

Backing up and restoring a MySQL database in PHP can be achieved by following these steps: Back up the database: Use the mysqldump command to dump the database into a SQL file. Restore database: Use the mysql command to restore the database from SQL files.

How to optimize MySQL query performance in PHP? How to optimize MySQL query performance in PHP? Jun 03, 2024 pm 08:11 PM

MySQL query performance can be optimized by building indexes that reduce lookup time from linear complexity to logarithmic complexity. Use PreparedStatements to prevent SQL injection and improve query performance. Limit query results and reduce the amount of data processed by the server. Optimize join queries, including using appropriate join types, creating indexes, and considering using subqueries. Analyze queries to identify bottlenecks; use caching to reduce database load; optimize PHP code to minimize overhead.

How to insert data into a MySQL table using PHP? How to insert data into a MySQL table using PHP? Jun 02, 2024 pm 02:26 PM

How to insert data into MySQL table? Connect to the database: Use mysqli to establish a connection to the database. Prepare the SQL query: Write an INSERT statement to specify the columns and values ​​to be inserted. Execute query: Use the query() method to execute the insertion query. If successful, a confirmation message will be output.

How to create a MySQL table using PHP? How to create a MySQL table using PHP? Jun 04, 2024 pm 01:57 PM

Creating a MySQL table using PHP requires the following steps: Connect to the database. Create the database if it does not exist. Select a database. Create table. Execute the query. Close the connection.

How to use MySQL stored procedures in PHP? How to use MySQL stored procedures in PHP? Jun 02, 2024 pm 02:13 PM

To use MySQL stored procedures in PHP: Use PDO or the MySQLi extension to connect to a MySQL database. Prepare the statement to call the stored procedure. Execute the stored procedure. Process the result set (if the stored procedure returns results). Close the database connection.

How to fix mysql_native_password not loaded errors on MySQL 8.4 How to fix mysql_native_password not loaded errors on MySQL 8.4 Dec 09, 2024 am 11:42 AM

One of the major changes introduced in MySQL 8.4 (the latest LTS release as of 2024) is that the "MySQL Native Password" plugin is no longer enabled by default. Further, MySQL 9.0 removes this plugin completely. This change affects PHP and other app

The difference between oracle database and mysql The difference between oracle database and mysql May 10, 2024 am 01:54 AM

Oracle database and MySQL are both databases based on the relational model, but Oracle is superior in terms of compatibility, scalability, data types and security; while MySQL focuses on speed and flexibility and is more suitable for small to medium-sized data sets. . ① Oracle provides a wide range of data types, ② provides advanced security features, ③ is suitable for enterprise-level applications; ① MySQL supports NoSQL data types, ② has fewer security measures, and ③ is suitable for small to medium-sized applications.

See all articles