Is it possible to see all columns of all tables of a database without the data using sqlmap

I don't want to use -D database -T table manually for all the tables

  • 1
    It depends on what DBMS the target is using. – Rápli András Jan 23 '17 at 18:53

The following queries can be used to retrieve (MySQL):

the list of all tables: SELECT table_name FROM information_schema.tables
the list of all columns: SELECT column_name FROM information_schema.columns

  • Is there any other method to get them organised ? I mean like a table containing the columns names under their table – crismatiq Nov 24 '16 at 15:02
  • SELECT 1,concat(table_name,':', column_name),3,4 FROM information_schema.columns – Michal Koczwara Nov 24 '16 at 15:15


Please see the SQLmap --schema option.

Enumerate database management system schema

Switches: --schema and --exclude-sysdbs

User can retrieve a DBMS schema by using this switch. Schema listing will contain all databases, tables and columns, together with their respective types. In combination with --exclude-sysdbs only part of the schema containing non-system databases will be retrieved and shown.

SQLmap usage

  • you need to specify what table to get the columns from, which is what the OP wants to avoid – schroeder Mar 25 '17 at 15:47
  • Alright. Then --schema sounds like what the OP is after. – Anonymous Mar 25 '17 at 15:55
  • Can you confirm this and edit your answer with the correction and evidence? – schroeder Mar 25 '17 at 16:34


-D database --columns

No need to use the -T flag. Sqlmap will automatically get all columns of all tables.


If the database MySQL, you can see the all tables in database:

SELECT table_name FROM information_schema.tables WHERE table_schema=database()

You can find more important columns with this command. After that find the columns:

SELECT column_name FROM information.schema_columns WHERE table_name='tablename'

  • The OP asked for a sqlmap-specific answer; furthermore you should denote this is MySQL-specific. – Jens Erat Feb 22 '17 at 21:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.