wxynxyo 发表于 2013-1-25 21:39:57

使用MYSQL的命令导出数据库的信息

最近在bugfix,用户提出来一个issue,但是在本地检查不出问题,需要用户手动到服务器上的MYSQL,拿到某些表的数据。按照网上给的建议,自己写了一个简单。

    Step 1: enter mysqldump to check it.
shell>mysqldump
Usage: mysqldump database
OR   mysqldump --databases DB1
OR   mysqldump --all-databases
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 nbgstatrpt_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 nbgstatrpt_tps_dh> rpt_tps_dh.sql
Enter password:


Step 4: You can get rpt_tps_dh.sql and rpt_tps_min.sql under ‘/’.



=======================对MYSQL的操作==================================
shell>mysql
shell>use DB
shell>show tables
页: [1]
查看完整版本: 使用MYSQL的命令导出数据库的信息