Home >Database >Mysql Tutorial >mysql数据表最快速迁移,mysql的存储引擎为:myisam_MySQL

mysql数据表最快速迁移,mysql的存储引擎为:myisam_MySQL

WBOY
WBOYOriginal
2016-06-01 13:04:401455browse

需求:

开发产品过程中,有个项目分支,数据库需要带数据拷贝,但是表的数据很大,用传统的insert into .... select * ...非常慢!!

过程:

1.进入的mysql在linux上的文件目录

在/etc/my.cnf中可以找到mysql数据文件的地址

[root@idata-slave3 etc]# cat /etc/my.cnf
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0


[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid


default-character-set=utf8
[client]
password=123qwe

2.查看数据库目录

\

\

数据库列表:

\

\

我们的目标是从test复制数据到test1中:

test目录结构:

\

\

表信息:

\\

test1目录和表都是空的:

\\

3.拷贝文件

\\

4.修改权限

\\

5.查询

\

\

完成!!

Statement:
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