最近在bugfix,使用者提出來乙個issue,但是在本地檢查不出問題,需要使用者手動到伺服器上的mysql,拿到某些表的資料。按照網上給的建議,自己寫了乙個簡單。
step 1: enter mysqldump to check it.
shell>mysqldump
usage: mysqldump [options] database [tables]
or mysqldump [options] --databases [options] db1 [db2 db3...]
or mysqldump [options] --all-databases [options]
for more options, use mysqldump --help
step 2: export the table data of rpt_tps_min into rpt_tps_min.sql, and then enter the db password.
shell> mysqldump -u nbgstat -p nbgstat rpt_tps_min> rpt_tps_min.sql
enter password:
step 3: export the table data of rpt_tps_dh into rpt_tps_dh.sql, and then enter the db password.
shell>mysqldump -u nbgstat -p nbgstat rpt_tps_dh> rpt_tps_dh.sql
enter password:
step 4: you can get rpt_tps_dh.sql and rpt_tps_min.sql under 『/』.
匯出資料庫:musqldump -u root -p 《資料庫名字》 > test_init.sql
********************===對mysql的操作******************************====
shell>mysql
shell>use db
shell>show tables
mysql命令匯入匯出資料庫
mysql命令列匯出資料庫 mysql命令列匯出資料庫 1,進入mysql目錄下的bin資料夾 cd mysql中到bin資料夾的目錄 如我輸入的命令列 cd c program files mysql mysql server 4.1 bin 或者直接將windows的環境變數path中新增該目錄...
MySql命令匯入匯出資料庫
資料庫備份和恢復是工作中不可缺少的,雖然現在已經有很多影象工具可以幫助我們很容易的實現,但當在對原有資料庫進行重新編碼匯入匯出的場景下 工具就顯得很捉襟見肘,其實,命令列的匯入匯出很容易就解決了 root host mysqldmp uroot p r default character set u...
MySQL匯出匯出資料庫
預設匯出路徑為mysql的內建路徑,因此這裡都加上了 documents 作為路徑。匯出整個資料庫 mysqldump u root p test documents test.sql 匯出資料庫乙個表 mysqldump h hostname u username p password datab...