gaugeboson Posted April 26, 2008 Share Posted April 26, 2008 How do I select a particular database at the SQL command prompt? I am trying to run this: ALTER TABLE messages ADD FOREIGN KEY(topic_id) REFERENCES topics (id) ON DELETE CASCADE; What command do I type in to select a database? Say the database is called "X". Quote Link to comment Share on other sites More sharing options...
fenway Posted April 26, 2008 Share Posted April 26, 2008 USE X; Quote Link to comment Share on other sites More sharing options...
gaugeboson Posted April 26, 2008 Author Share Posted April 26, 2008 Well I selected the table just fine. But After I ran the query it gave me this error: ERROR 1005 (HY000): Can't create table './forum/#sql-149c_a.frm' (errno: 150) Quote Link to comment Share on other sites More sharing options...
fenway Posted April 26, 2008 Share Posted April 26, 2008 That usually means that your data types aren't identical. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.