MySQL->导出/导入资料[20180521]
mysql> select count(*) from seq_test;
+----------+
| count(*) |
+----------+
| 111 |
+----------+
1 row in set (0.00 sec) mysql> truncate table seq_test;
Query OK, 0 rows affected (0.00 sec) mysql> LOAD DATA LOCAL INFILE '/tmp/backup_v0.txt' INTO TABLE seq_test;
Query OK, 111 rows affected (0.00 sec)
Records: 111 Deleted: 0 Skipped: 0 Warnings: 0 mysql> select count(*) from seq_test;
+----------+
| count(*) |
+----------+
| 111 |
+----------+
1 row in set (0.00 sec)
[root@t-xi-mysql01 tmp]# cp backup_v0.txt seq_test.txt[root@t-xi-mysql01 tmp]# mysqlimport -u root -p --local runoob seq_test.txtEnter password:runoob.seq_test: Records: 111 Deleted: 0 Skipped: 111 Warnings: 0
[root@t-xi-mysql01 tmp]# mysqldump -u root -p runoob seq_test|gzip > backup_data.zip
Enter password:
[root@t-xi-mysql01 tmp]# gunzip -c backup_data.zip>backup_data.sql
[root@t-xi-mysql01 tmp]#
[root@t-xi-mysql01 tmp]# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18
Server version: 5.1.71 Source distribution Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use runoob;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A Database changed
mysql> source backup_data.sql
Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.01 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 111 rows affected (0.00 sec)
Records: 111 Duplicates: 0 Warnings: 0 Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec) Query OK, 0 rows affected (0.00 sec)
mysql> select count(*) from seq_test;
+----------+
| count(*) |
+----------+
| 111 |
+----------+
1 row in set (0.00 sec)
MySQL->导出/导入资料[20180521]的更多相关文章
- [转]mysql导出导入中文表解决方法
在开发过程中会经常用到mysql导出导入中文表,本文将详细介绍其如何使用,需要的朋友可以参考下. 在开发过程中会经常用到mysql导出导入中文表,本文将详细介绍其如何使用,需要的朋友可以参考下一.先针 ...
- mysql导出导入某张表
一般表数据少的话都用图形界面了,看着比较方便. 如果表中数据比较多,用图形界面极容易卡死,这个时候就要用到命令行了. 用命令行导出导入大量数据还是比较快的,方法如下: 导出库db1中的表table1: ...
- Mysql导出导入乱码问题解决
MySQL从4.1版本开始才提出字符集的概念,所以对于MySQL4.0及其以下的版本,他们的字符集都是Latin1的,所以有时候需要对mysql的字符集进行一下转换,MySQL版本的升级.降级,特别是 ...
- mysql导出导入数据
使用sql语句导出数据: 导出时如果不写绝对路径,会提示The MySQL server is running with the --secure-file-priv option so it can ...
- mysql导出导入数据库表
1.下载数据库 mysqldump db_name -h 192.168.5.162 -uroot -p > /var/www/db_name.sql(这个可以自定义) 2,下载数据库中的某个 ...
- Mysql 导出导入
MySQL数据库导出 以root登录vps,执行以下命令导出. 1./usr/local/mysql/bin/mysqldump -u root -p123456 zhumaohai > /ho ...
- MySQL导出导入命令的用例
1.导出整个数据库 mysqldump -u 用户名 -p 数据库名 > 导出的文件名 mysqldump -u wcnc -p smgp_apps_wcnc > wcnc.sql 2.导 ...
- mysql 导出导入数据 -csv
MySql数据库导出csv文件命令: mysql> select first_name,last_name,email from account into outfile 'e://output ...
- mysql导出导入数据库和表学习笔记
一.mysql导出数据库和表 1.导出单个数据库 mysqldump [-h Host] -u Username -p [PASSWORD] db_name > db_name.sql 2.导出 ...
随机推荐
- 如何使用火狐浏览器的Poster插件进行post请求
原文:http://blog.csdn.net/cjm2484836553/article/details/72453907 版权声明:本文为博主原创文章,未经博主允许不得转载. 目录(?)[-] ...
- CentOS 7.2mini版本下编译安装php7.0.10+MySQL5.7.14+Nginx1.10.1
一.安装前的准备工作 1.yum update #更新系统 1.1)vi /etc/selinux/config # 禁止SELINUX,设置SELINUX=disabled 2.yum in ...
- Linux常用命令(三)————创建+删除+设置权限
1. mkdir mkdir [选项] DirName 命令中的[选项]: -m 用于对新建目录设置存取权限,也可以用 chmod 命令进行设置. -p 需要时创建上层文件夹(或目录), ...
- (转)informatica 面试题大全
1 What is the difference between a data warehouse and a data mart? Ø Dataware house: It is a collect ...
- 一、C#简单读写
using System.IO; static string configFileName = "config.json"; //不存在就直接新建文件夹 public static ...
- 采用powershell创建project网站集(摘抄自https://www.cnblogs.com/jindahao/p/5855668.html)
采用powershell创建project网站集,具体步骤如下 1.输入License Enable-ProjectServerLicense –Key "23CB6-N4X8Q-WWD7M ...
- [翻译] JTNumberScrollAnimatedView
JTNumberScrollAnimatedView 本人视频教程系类 iOS中CALayer的使用 效果: Use JTNumberScrollAnimatedView for have a n ...
- 添加PHP扩展模块
php安装好后,可能在初次安装时,会有些模块会有遗漏,但是我们又不想重新编译php,因为耗时是比较长的.我们可不可以在不重新编译安装php的情况下,来为php单独添加某一个模块呢?查找资料,发现还是有 ...
- phpstrom设置php环境
phpstorm设置自动同步服务器 Tools->Deployment->Confinguration 点+号,添加服务器,类型SFTP,输入name 点击ok,项目与服务器连接成功! 设 ...
- 使用NPOI 2.1.1读取EXCEL2003/2007返回DataTable
winform中打开excel的筛选器设置为:openFileDialog.Filter = "Excel 文件(*.xls)|*.xls;*.xlsx"; 一,不借助插件读取Ex ...