亚洲视频二区_亚洲欧洲日本天天堂在线观看_日韩一区二区在线观看_中文字幕不卡一区

公告:魔扣目錄網為廣大站長提供免費收錄網站服務,提交前請做好本站友鏈:【 網站目錄:http://www.430618.com 】, 免友鏈快審服務(50元/站),

點擊這里在線咨詢客服
新站提交
  • 網站:51998
  • 待審:31
  • 小程序:12
  • 文章:1030137
  • 會員:747

1.前言

作為一名技術人員,少不了接觸數據庫,那么當遇到一個舊項目數據庫表比較多,怎么快速的導出表結構,形成文檔方便后續跟進呢?今天我給大家安利一個好用的工具MySQL_markdown。

工具-MySQL數據庫表結構快速導出成MarkDown文檔

 

2.工具官網代碼地址

https://github.com/alicfeng/mysql_markdown

它是一款基于 go 語言編寫的一個命令行工具,適用于 linux、mac、windows等平臺。

3.直接部署(小白推薦方式)

發布包從官網代碼直接下載安裝

https://github.com/alicfeng/mysql_markdown/releases
工具-MySQL數據庫表結構快速導出成MarkDown文檔

下載穩定版本

4.編譯部署

有時候我們需要使用工具新特性,可以自行編譯此工具,這里也介紹下如何編譯最新代碼。

4.1部署Go環境

  • 官網下載Go安裝包

官網
https://golang.google.cn/dl/下載go安裝包,選擇合適的平臺下載安裝即可。

工具-MySQL數據庫表結構快速導出成MarkDown文檔

Go官網

  • 這里我是macos平臺,下載后默認安裝在/usr/local/go/目錄下。
  • 配置環境變量,追加環境變量。
$ vim ~/.bash_profile

export GOROOT=/usr/local/go/
export GOBIN=$GOROOT/bin

export 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 --help
Usage: 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 mysql
1/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文件。

工具-MySQL數據庫表結構快速導出成MarkDown文檔

Typora打開md文檔

7.結束

是不是很簡單,生成表結構文檔,so easy。你學會了嗎?

分享到:
標簽:文檔 MarkDown
用戶無頭像

網友整理

注冊時間:

網站:5 個   小程序:0 個  文章:12 篇

  • 51998

    網站

  • 12

    小程序

  • 1030137

    文章

  • 747

    會員

趕快注冊賬號,推廣您的網站吧!
最新入駐小程序

數獨大挑戰2018-06-03

數獨一種數學游戲,玩家需要根據9

答題星2018-06-03

您可以通過答題星輕松地創建試卷

全階人生考試2018-06-03

各種考試題,題庫,初中,高中,大學四六

運動步數有氧達人2018-06-03

記錄運動步數,積累氧氣值。還可偷

每日養生app2018-06-03

每日養生,天天健康

體育訓練成績評定2018-06-03

通用課目體育訓練成績評定