1.序言

做为一个专业技术人员,触碰数据库查询是务必的,那麼当一个老新项目中有很多数据库表时,怎么才能导出来表结构并产生文本文档便捷事后呢?今日我也给各位讲解一个功能强大的专用工具mysql_markdown。

linux导出mysql数据库命令-linux备份mysql数据库的方法-第1张图片2.专用工具官网编码详细地址。https://GitHub.com/alicfeng/mysql_markdown

它是根据go语言表达的命令行工具,适用Linux,Mac,Windows等服务平台。

3.立即布署(新手提议)。

程序包立即从官方网站编码安装下载。

https://github.com/alicfeng/mysql_markdown/releases

linux导出mysql数据库命令-linux备份mysql数据库的方法-第2张图片

免费下载稳定版。

4.编译程序布署。

有时候人们必须运用专用工具的新特点,我们可以自身编译程序这一专用工具。在这儿,大家还详细介绍了怎样编译程序全新的编码。

4.1布署Go自然环境。

官方网站下载Go安装文件

官方网站https://golang.Google.cn/dl/免费下载go安装包,挑选适宜的服务平台安装下载就可以。linux导出mysql数据库命令-linux备份mysql数据库的方法-第3张图片官方网站下载go安装包,挑选适宜的服务平台安装下载。

Go官网

这儿我是macos平台,免费下载后默认设置安裝在/usr/local/go/文件目录下。配备系统变量,增加系统变量。$ vim ~/.bash_profileexport GOROOT=/usr/local/go/export GOBIN=$GOROOT/binexport PATH=$GOBIN:$PATH起效系统变量$ source ~/.bash_profile认证是不是起效$ which go/usr/local/go/bin/go

4.2编译程序专用工具。

编译程序安裝(有编译程序专业知识的朋友能够自身编译程序)。

$ git clone https://github.com/alicfeng/mysql_markdown.git$ cd mysql_markdown$ go get "github.com/go-sql-driver/mysql"$ go build -o /usr/local/bin/mysql_markdown mysql_markdown.go$ chmod x /usr/local/bin/mysql_markdown

5.专用工具英语的语法。

$ ./mysql_markdown_mac --helpUsage: mysql_markdown [options...]--help This help text-h host. default 127.0.0.1-u username. default root-p password. default root-d database. default mysql-P port. default 3306-c charset. default utf8-o output. default current location-t tables. default all table and support ',' separator for filter

它像mysql语法一样非常容易应用吗?

6.常用工具。

我终导出来mysql表为例子。一定要注意,主要参数选择项和变量值应是空。请记牢!

$ ./mysql_markdown_mac -h 10.10.10.10 -P 33706 -u root -p kkdd123 -d mysql1/31 the columns_priv table is making ...2/31 the db table is making ...3/31 the engine_cost table is making ...4/31 the event table is making ...5/31 the func table is making ...6/31 the general_log table is making ...7/31 the gtid_executed table is making ...8/31 the help_category table is making ...9/31 the help_keyword table is making ...10/31 the help_relation table is making ...11/31 the help_topic table is making ...12/31 the innodb_index_stats table is making ...13/31 the innodb_table_stats table is making ...14/31 the ndb_binlog_index table is making ...15/31 the plugin table is making ...16/31 the proc table is making ...17/31 the procs_priv table is making ...18/31 the proxies_priv table is making ...19/31 the server_cost table is making ...20/31 the servers table is making ...21/31 the slave_master_info table is making ...22/31 the slave_relay_log_info table is making ...23/31 the slave_worker_info table is making ...24/31 the slow_log table is making ...25/31 the tables_priv table is making ...26/31 the time_zone table is making ...27/31 the time_zone_leap_second table is making ...28/31 the time_zone_name table is making ...29/31 the time_zone_transition table is making ...30/31 the time_zone_transition_type table is making ...31/31 the user table is making ...mysql_markdown finished ...

随后你就会见到文件列表下能转化成一个mysql_20200610_103451.md文件。linux导出mysql数据库命令-linux备份mysql数据库的方法-第4张图片随后你就会看见在文件列表下能转化成一个mysql_20200610_103451.md文件。

Typora开启md文档。

7.总体目标

转化成表结构文本文档并不是非常简单吗,那么非常容易?你学好了没有?

假如你喜爱本文里的朋友,能够留意一下,个人收藏一下。不明白的还可以评价留言板留言。

评论(0条)

刀客源码 游客评论