Click Technology

Linux, Windows, Mac it's all good

Display the fields in a MySQL table..

September18

Simple command that you sometimes need. Obviously this runs from the mysql client prompt, so open a command line and type

mysql -u root -p

and then enter the root password for your mySQL database.

Then, switch to your database…

USE yourdatabasename;

An now, all you need is..

SHOW columns FROM your_table;

OR

SELECT COLUMN_NAME' FROM 'INFORMATION_SCHEMA'.'COLUMNS'
WHERE 'TABLE_SCHEMA'='YOUR_DATABASE'
AND 'TABLE_NAME'='YOUR_TABLE';

Nice.

posted under Linux Tips

Email will not be published

Website example

Your Comment:

This is my website for short blog posts and interesting materials that are noteworthy or have some handy-tip value.