How to export / dump a MySql table into a text file including the field names (aka headers or column names)

后端 未结 6 931
盖世英雄少女心
盖世英雄少女心 2020-11-29 05:05

In MySql\'s interpreter, it\'s very easy to dump a table to the screen along with its field names.

There seems to be no simple way to export a table to a tab-delimt

6条回答
  •  既然无缘
    2020-11-29 05:29

    I used the above command and modified according to my requirement.
    I needed to get passwords column from the wordpress mysql database in a text file , to do that i used the following below command

    echo "select user_pass from wp_users"| mysql -uroot -proot wp_database > passwordList.txt
    

提交回复
热议问题