标签云
asm恢复 bbed bootstrap$ dul In Memory kcbzib_kcrsds_1 kccpb_sanity_check_2 kfed MySQL恢复 ORA-00312 ORA-00607 ORA-00704 ORA-01110 ORA-01555 ORA-01578 ORA-08103 ORA-600 2131 ORA-600 2662 ORA-600 2663 ORA-600 3020 ORA-600 4000 ORA-600 4137 ORA-600 4193 ORA-600 4194 ORA-600 16703 ORA-600 kcbzib_kcrsds_1 ORA-600 KCLCHKBLK_4 ORA-15042 ORA-15196 ORACLE 12C oracle dul ORACLE PATCH Oracle Recovery Tools oracle加密恢复 oracle勒索 oracle勒索恢复 oracle异常恢复 Oracle 恢复 ORACLE恢复 ORACLE数据库恢复 oracle 比特币 OSD-04016 YOUR FILES ARE ENCRYPTED 勒索恢复 比特币加密文章分类
- Others (2)
- 中间件 (2)
- WebLogic (2)
- 操作系统 (102)
- 数据库 (1,671)
- DB2 (22)
- MySQL (73)
- Oracle (1,533)
- Data Guard (52)
- EXADATA (8)
- GoldenGate (21)
- ORA-xxxxx (159)
- ORACLE 12C (72)
- ORACLE 18C (6)
- ORACLE 19C (14)
- ORACLE 21C (3)
- Oracle 23ai (7)
- Oracle ASM (65)
- Oracle Bug (8)
- Oracle RAC (52)
- Oracle 安全 (6)
- Oracle 开发 (28)
- Oracle 监听 (28)
- Oracle备份恢复 (560)
- Oracle安装升级 (92)
- Oracle性能优化 (62)
- 专题索引 (5)
- 勒索恢复 (78)
- PostgreSQL (18)
- PostgreSQL恢复 (6)
- SQL Server (27)
- SQL Server恢复 (8)
- TimesTen (7)
- 达梦数据库 (2)
- 生活娱乐 (2)
- 至理名言 (11)
- 虚拟化 (2)
- VMware (2)
- 软件开发 (37)
- Asp.Net (9)
- JavaScript (12)
- PHP (2)
- 小工具 (20)
-
最近发表
- Kylin Linux 安装19c
- ORA-600 krse_arc_complete.4
- Oracle 19c 202410补丁(RUs+OJVM)
- ntfs MFT损坏(ntfs文件系统故障)导致oracle异常恢复
- .mkp扩展名oracle数据文件加密恢复
- 清空redo,导致ORA-27048: skgfifi: file header information is invalid
- A_H_README_TO_RECOVER勒索恢复
- 通过alert日志分析客户自行对一个数据库恢复的来龙去脉和点评
- ORA-12514: TNS: 监听进程不能解析在连接描述符中给出的SERVICE_NAME
- ORA-01092 ORA-00604 ORA-01558故障处理
- ORA-65088: database open should be retried
- Oracle 19c异常恢复—ORA-01209/ORA-65088
- ORA-600 16703故障再现
- 数据库启动报ORA-27102 OSD-00026 O/S-Error: (OS 1455)
- .[metro777@cock.li].Elbie勒索病毒加密数据库恢复
- 应用连接错误,初始化mysql数据库恢复
- RAC默认服务配置优先节点
- Oracle 19c RAC 替换私网操作
- 监听报TNS-12541 TNS-12560 TNS-00511错误
- drop tablespace xxx including contents恢复
分类目录归档:MySQL
mysql 5.5 源码安装
1.安装cmake
1)下载cmake
#wget http://www.cmake.org/files/v2.8/cmake-2.8.3.tar.gz
2)解压cmake
#tar -zvxf cmake-2.8.3.tar.gz
3)配置编译
#cd cmake-2.8.3
#yum -y install gcc
#yum -y install gcc-c++
#./configure
#make
#make install
2.安装MYSQL
1)下载MYSQL
mkdir /opt/mysql_src
#cd /opt/mysql_src
#wget http://dev.mysql.com/get/Downloads/MySQL-5.5/mysql-5.5.14.tar.gz/from/http://mysql.mirror.rafal.ca/
2)解压mysql-5.5.14.tar.gz
#tar -zvxf mysql-5.5.14.tar.gz
创建目录(mysql5.5默认已经没有data目录了)
mkdir -p /opt/mysql_src/product
mkdir -p /opt/mysql_src/data
3)配置编译
#cd mysql-5.5.14
#cmake . ##这个方法,安装路径默认
或
#cmake . \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DCMAKE_INSTALL_PREFIX:PATH=/opt/mysql_src/product \
-DCOMMUNITY_BUILD:BOOL=ON \
-DENABLED_PROFILING:BOOL=ON \
-DENABLE_DEBUG_SYNC:BOOL=OFF \
-DINSTALL_LAYOUT:STRING=STANDALONE \
-DMYSQL_DATADIR:PATH=/opt/mysql_src/data \
-DMYSQL_MAINTAINER_MODE:BOOL=OFF \
-DWITH_EMBEDDED_SERVER:BOOL=ON \
-DWITH_EXTRA_CHARSETS:STRING=all \
-DWITH_SSL:STRING=bundled \
-DWITH_UNIT_TESTS:BOOL=OFF \
-DWITH_ZLIB:STRING=bundled \
-LH
如果出现一下错误:
cmake .
– MySQL 5.5.14
– Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:82 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5-dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:126 (FIND_CURSES)
cmake/readline.cmake:216 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:256 (MYSQL_CHECK_READLINE)
– Configuring incomplete, errors occurred!
需要安装ncurses-devel包
# yum -y install ncurses-devel
#make
#make install
#groupadd mysql
#useradd -r -g mysql mysql
#cd /opt/mysql_sc
#chown -R mysql:mysql .
#scripts/mysql_install_db –user=mysql
添加标准/etc/my.cnf文件(见mysql二进制安装程序,修改相关路径)
#./bin/mysqld_safe –user=mysql &
mysqldump+mysqlbinlog恢复测试
一、模拟环境
mysql> create database test;
Query OK, 1 row affected (0.02 sec)
mysql> use test;
Database changed
mysql> reset master;
Query OK, 0 rows affected (0.04 sec)
mysql> show binary logs;
+—————–+———–+
| Log_name | File_size |
+—————–+———–+
| mysqlbin.000001 | 107 |
+—————–+———–+
1 row in set (0.00 sec)
mysql> create table t(id int,name varchar(10));
Query OK, 0 rows affected (0.09 sec)
mysql> insert into t values(1,’aaaa’);
Query OK, 1 row affected (0.01 sec)
mysql> insert into t values(2,’bbbb’);
Query OK, 1 row affected (0.00 sec)
二、使用mysqldump备份数据
mysqldump -u root -ppassw0rd –skip-opt –extended-insert=false –master-data=2 –single-transaction –allow-keywords –add-locks –add-drop-table -F -q test >/tmp/test.sql
三、继续操作
mysql> insert into t values(3,’cccc’);
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect…
Connection id: 208
Current database: test
Query OK, 1 row affected (0.00 sec)
mysql> insert into t values(4,’dddd’);
Query OK, 1 row affected (0.00 sec)
mysql> drop table t;
Query OK, 0 rows affected (0.04 sec)
mysql> create table t1 as
-> select * from information_schema.tables;
Query OK, 79 rows affected (0.27 sec)
Records: 79 Duplicates: 0 Warnings: 0
四、报告误删除表,开始恢复准备
mysql> show binary logs;
+—————–+———–+
| Log_name | File_size |
+—————–+———–+
| mysqlbin.000001 | 605 |
| mysqlbin.000002 | 14686 |
+—————–+———–+
2 rows in set (0.00 sec)
tee /tmp/output.txt
Logging to file ‘/tmp/output.txt’
mysql> show binlog events in ‘mysqlbin.000002′;
……………………省略
mysql> notee
Outfile disabled.
mysql> exit
Bye
查找删除表的位置(起点和终点)
[root@ECP-UC-DB1 tmp]# cat output.txt |grep “DROP TABLE”
| mysqlbin.000002 | 461 | Query | 1 | 564 | use `test`; DROP TABLE `t` /* generated by server */
[root@ECP-UC-DB1 mysqllog]# cat /tmp/test.sql |grep MASTER
– CHANGE MASTER TO MASTER_LOG_FILE=’mysqlbin.000002′, MASTER_LOG_POS=107;
生成恢复sql语句
mysqlbinlog –start-position=107 –stop-position=461 mysqlbin.000002>/tmp/drop.sql
mysqlbinlog –start-position=564 mysqlbin.000002>>/tmp/drop.sql
五、开始恢复
找一个测试库,拷贝/tmp/drop.sql和/tmp/test.sql到备库,然后进行恢复
mysql> create database test;
Query OK, 1 row affected (0.00 sec)
mysql> use test;
Database changed
mysql> source /tmp/test.sql
mysql> source /tmp/drop.sql
六、测试恢复结果
mysql> show tables;
+—————-+
| Tables_in_test |
+—————-+
| t |
| t1 |
+—————-+
2 rows in set (0.00 sec)
mysql> select * from t;
+——+——+
| id | name |
+——+——+
| 1 | aaaa |
| 2 | bbbb |
| 3 | cccc |
| 4 | dddd |
+——+——+
4 rows in set (0.00 sec)
mysql> select count(*) from t1;
+———-+
| count(*) |
+———-+
| 79 |
+———-+
1 row in set (0.02 sec)
mysqlbinlog参数介绍
Dumps a MySQL binary log in a format usable for viewing or for piping to
the mysql command line client.
Usage: mysqlbinlog [options] log-files
-?, –help Display this help and exit.
–base64-output[=name]
Determine when the output statements should be
base64-encoded BINLOG statements: ‘never’ disables it and
works only for binlogs without row-based events;
‘decode-rows’ decodes row events into commented SQL
statements if the –verbose option is also given; ‘auto’
prints base64 only when necessary (i.e., for row-based
events and format description events); ‘always’ prints
base64 whenever possible. ‘always’ is deprecated, will be
removed in a future version, and should not be used in a
production system. –base64-output with no ‘name’
argument is equivalent to –base64-output=always and is
also deprecated. If no –base64-output[=name] option is
given at all, the default is ‘auto’.
–character-sets-dir=name
Directory for character set files.
-d, –database=name List entries for just this database (local log only).
–debug-check Check memory and open file usage at exit .
–debug-info Print some debug info at exit.
–default-auth=name Default authentication client-side plugin to use.
-D, –disable-log-bin
Disable binary log. This is useful, if you enabled
–to-last-log and are sending the output to the same
MySQL server. This way you could avoid an endless loop.
You would also like to use it when restoring after a
crash to avoid duplication of the statements you already
have. NOTE: you will need a SUPER privilege to use this
option.
-F, –force-if-open Force if binlog was not closed properly.
(Defaults to on; use –skip-force-if-open to disable.)
-f, –force-read Force reading unknown binlog events.
-H, –hexdump Augment output with hexadecimal and ASCII event dump.
-h, –host=name Get the binlog from server.
-l, –local-load=name
Prepare local temporary files for LOAD DATA INFILE in the
specified directory.
-o, –offset=# Skip the first N entries.
-p, –password[=name]
Password to connect to remote server.
–plugin-dir=name Directory for client-side plugins.
-P, –port=# Port number to use for connection or 0 for default to, in
order of preference, my.cnf, $MYSQL_TCP_PORT,
/etc/services, built-in default (3306).
–protocol=name The protocol to use for connection (tcp, socket, pipe,
memory).
-R, –read-from-remote-server
Read binary logs from a MySQL server.
-r, –result-file=name
Direct output to a given file.
–server-id=# Extract only binlog entries created by the server having
the given id.
–set-charset=name Add ‘SET NAMES character_set’ to the output.
-s, –short-form Just show regular queries: no extra info and no row-based
events. This is for testing only, and should not be used
in production systems. If you want to suppress
base64-output, consider using –base64-output=never
instead.
-S, –socket=name The socket file to use for connection.
–start-datetime=name
Start reading the binlog at first event having a datetime
equal or posterior to the argument; the argument must be
a date and time in the local time zone, in any format
accepted by the MySQL server for DATETIME and TIMESTAMP
types, for example: 2004-12-25 11:25:56 (you should
probably use quotes for your shell to set it properly).
-j, –start-position=#
Start reading the binlog at position N. Applies to the
first binlog passed on the command line.
–stop-datetime=name
Stop reading the binlog at first event having a datetime
equal or posterior to the argument; the argument must be
a date and time in the local time zone, in any format
accepted by the MySQL server for DATETIME and TIMESTAMP
types, for example: 2004-12-25 11:25:56 (you should
probably use quotes for your shell to set it properly).
–stop-position=# Stop reading the binlog at position N. Applies to the
last binlog passed on the command line.
-t, –to-last-log Requires -R. Will not stop at the end of the requested
binlog but rather continue printing until the end of the
last binlog of the MySQL server. If you send the output
to the same MySQL server, that may lead to an endless
loop.
-u, –user=name Connect to the remote server as username.
-v, –verbose Reconstruct SQL statements out of row events. -v -v adds
comments on column data types.
-V, –version Print version and exit.
–open-files-limit=#
Used to reserve file descriptors for use by this program.
Variables (–variable-name=value)
and boolean options {FALSE|TRUE} Value (after reading options)
——————————— —————————————-
base64-output (No default value)
character-sets-dir (No default value)
database (No default value)
debug-check FALSE
debug-info FALSE
default-auth (No default value)
disable-log-bin FALSE
force-if-open TRUE
force-read FALSE
hexdump FALSE
host (No default value)
local-load (No default value)
offset 0
plugin-dir (No default value)
port 3306
read-from-remote-server FALSE
server-id 0
set-charset (No default value)
short-form FALSE
socket /var/run/mysqld/mysqld.sock
start-datetime (No default value)
start-position 4
stop-datetime (No default value)
stop-position 18446744073709551615
to-last-log FALSE
user (No default value)
open-files-limit 64
发表在 MySQL
评论关闭