加入收藏 | 设为首页 | 会员中心 | 我要投稿 武汉站长网 (https://www.027zz.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

linux 批量重命名文件

发布时间:2021-02-06 08:56:18 所属栏目:Linux 来源:网络整理
导读:1. 分隔 ?>>split -l 5 data_out.sql test 2.重命名 >>for j in test*; do mv -v -- "$j" "$j.sql";done To export If it's an entire DB,then: If it's all DBs,then: all_db_backup.sql If it's specific tables within a DB,then: You can even go as f

1. 分隔

?>>split -l 5 data_out.sql test

2.重命名

>>for j in test*; do mv -v -- "$j" "$j.sql";done

To export

If it's an entire DB,then:


If it's all DBs,then:

 all_db_backup.sql

If it's specific tables within a DB,then:


You can even go as far as auto-compressing the output using gzip (if your DB is very big):


If you want to do this remotely and you have the access to the server in question,then the following would work (presuming the MySQL server is on port 3306):


To import

Type the following command to import sql data file:


In this example,import 'data.sql' file into 'blog' database using?Sathish?as username:


If you have a dedicated database server,replace localhost hostname with with actual server name or IP address as follows:


OR use hostname such as mysql.cyberciti.biz


If you do not know the database name or database name is included in sql dump you can try out something as follows:


Refer:?

If you want a GUI tool then you could probably use?

参考文献:

http://stackoverflow.com/questions/11407349/mysql-how-to-export-and-import-an-sql-file-from-command-line

(编辑:武汉站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读