Calvin College Emulab Project
Mysql tips
Assume that you have typed mysql tbdb
- show tables; will show you all the tables in the
database, and there are a lot of them.
- desc table_name; will show you all the fields
in the table table_name.
- select * from table_name; will show you all the data
in the table table_name.
- select * from table_name where
field=value; will display all the data in rows for which
field_name has the value value.
- select field_name from table_name; will show you all
the data from the field field_name in the table table_name.
Separate multiple field names with commas to get a nice
tablular output.
- upate table_name set field1=value1 where
field2=value2; will change the value of field2 for all
rows for which field1 has the value value1.
- upate table_name set field1=value1 where
field2=value2; will change the value of field2 for all
rows for which field1 has the value value1.
- delete from table_name where
field=value; will delete all
rows for which field has the value value.