我有大型数据库22GB.我曾经用mysqldumpgzip格式的命令备份.
当我提取gz文件时,它生成的.sql文件16.2GB
当我尝试在本地服务器中导入数据库时,导入大约需要48小时.有没有办法提高导入过程的速度?
此外,我想知道是否需要进行任何硬件更改以提高性能.
当前系统配置
Processor: 4th Gen i5
RAM: 8GB
Run Code Online (Sandbox Code Playgroud)
#UPDATE
my.cnf如下
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to …Run Code Online (Sandbox Code Playgroud) 大约2个月前,我将EnWikipedia数据(http://dumps.wikimedia.org/enwiki/20120211/)导入mysql.
完成导入EnWikipedia数据后,我一直在mysql的EnWikipedia数据库表中创建索引大约2个月.
现在,我已经达到了在"pagelinks"中创建索引的程度.
但是,通过这一点似乎需要无限的时间.
因此,我检查了剩余的时间,以确保我的直觉是正确的.
因此,预计剩余时间为60天(假设我从头开始再次在"pagelinks"中创建索引.)
My EnWikipedia database has 7 tables:
"categorylinks"(records: 60 mil, size: 23.5 GiB),
"langlinks"(records: 15 mil, size: 1.5 GiB),
"page"(records: 26 mil, size 4.9 GiB),
"pagelinks"(records: 630 mil, size: 56.4 GiB),
"redirect"(records: 6 mil, size: 327.8 MiB),
"revision"(records: 26 mil, size: 4.6 GiB) and "text"(records: 26 mil, size: 60.8 GiB).
Run Code Online (Sandbox Code Playgroud)
我的服务器是...... Linux版本2.6.32-5-amd64(Debian 2.6.32-39),内存16GB,2.39Ghz Intel 4核心
创造指数需要这么长时间的常见现象吗?有没有人有更好的解决方案来更快地创建索引?
提前致谢 !
PS:我做了以下操作来检查剩余时间.
参考文献(对不起,以下页面用日文写成):http://d.hatena.ne.jp/sh2/20110615
1.我在"pagelink"中有记录.
mysql> select count(*) from pagelinks;
+-----------+
| count(*) |
+-----------+
| …Run Code Online (Sandbox Code Playgroud) 嗨,我使用的是Mysql 5.0.x.
我刚刚将很多表从MyISAM改为InnoDB
使用MyISAM表大约需要1分钟来安装我们的数据库使用InnoDB大约需要15分钟来安装相同的数据库
为什么InnoDB需要这么长时间?
我该怎么做才能加快速度?
数据库安装执行以下步骤
1)删除架构
2)创建架构
3)创建表
4)创建存储过程
5)插入默认数据
6)通过存储过程插入数据
编辑:
大多数情况下,插入默认数据