Coderguy’s Blog

Thoughts on code

About

Hello, my name is Daniel Ice. I am a software developer in the Dallas, TX area. I enjoy learning about new technology. I mostly focus on PHP and Ruby on Rails.

Archive for the 'MySQL' Category

Show Forgein Keys in MySQL

Wednesday, November 25th, 2009

Here is a handy query I found the mysql reference manual for how to see all the foreign keys in a database:

SELECT ke.referenced_table_name parent, ke.table_name child, ke.constraint_name
FROM information_schema.KEY_COLUMN_USAGE ke
WHERE ke.referenced_table_name IS NOT NULL
ORDER BY ke.referenced_table_name;

Read the rest of this entry »

Refresh MySQL Autocomplete: \#

Thursday, June 25th, 2009

Here is nifty little tip.  If you need to have your command line MySQL autocomplete enabled or refresh the just type \# at the command line.
mysql>\#
This is great for those times when you creating a lot of tables.

Read the rest of this entry »