简体   繁体   English

如何从Phpmyadmin中的数据库表中仅导出两列?

[英]How to export only two columns from database table in Phpmyadmin?

I am pretty noob at databases yet. 我对数据库还算不错。 I am trying to export two columns from table, ID and CONF_TEXT in txt file or any other format as ID, Conf_text (ex: 121,Conf text...). 我正在尝试从表中将两列ID和CONF_TEXT导出为txt文件或任何其他格式作为ID Conf_text(例如:121,Conf文本...)。 数据库表

Anyone done the same before? 有人做过同样的事吗?

Thank You. 谢谢。

Instead of using 而不是使用

SELECT * FROM 'conf'

use 采用

SELECT ID,CONF_TEXT FROM 'conf'

and them export 他们出口

Just click on the SQL tab of phpMyAdmin and fire the following query: 只需单击phpMyAdmin的SQL选项卡并触发以下查询:

SELECT ID, CONF_TEXT INTO OUTFILE 'abc.txt' FROM conf ; SELECT ID,CONF_TEXT INTO OUTFILE'abc.txt'FROM conf ;

Then go to your xampp/wamp/mamp folder, then go inside mysql folder then in the data folder just search for the 'abc.txt' file. 然后转到您的xampp / wamp / mamp文件夹,然后进入mysql文件夹,然后在数据文件夹中仅搜索“ abc.txt”文件。 (Just search for the file name in the search box once you are inside data folder of mysql, you will get your abc.txt file having the data of two columns). (一旦您进入mysql的数据文件夹,只需在搜索框中搜索文件名,您将得到具有两列数据的abc.txt文件)。 Similarly, to get the file in csv format, change the extension of from .txt to .csv 同样,要以csv格式获取文件,请将.txt的扩展名从.txt更改为.csv

Hope this helps!!! 希望这可以帮助!!!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM