Jump to content

Extracting table info from script


Brandon Jaeger

Recommended Posts

Guest prozente

The only way to get it from the script is to go through the script. If you want to get the information from the database then this is much simpler.

 

Assuming this is MySQL you would open the mysql utility

mysql -u database_username -p

It will prompt you for the password, enter it and then it will connect the the MySQL daemon

 

Then you'd select the database you want to look at

Use database_name;

 

Now you can show the tables in the database

Show tables;

 

Now that you know the table names you can look at each table, too see the different fields and the field types you can use

Describe table_name;

 

If you want to see the query used to create the table you would do

Show create table table_name;

 

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.