OriginalSunny Posted March 21, 2006 Share Posted March 21, 2006 Hi, I need to know how to change the name of some columns in my database. I would also like to change the name of my database. All of this without altering data stored in the database or dropping anyhing. If you know the syntax to do this please let me know. Thanks. Quote Link to comment Share on other sites More sharing options...
wickning1 Posted March 21, 2006 Share Posted March 21, 2006 ALTER TABLE will change table and column names, ALTER DATABASE will change database name... See the documentation at www.mysql.com for more details. Quote Link to comment Share on other sites More sharing options...
fenway Posted March 23, 2006 Share Posted March 23, 2006 To change a column name:[code]ALTER TABLE yourTable CHANGE COLUMN yourOldColumn yourNewColumn <column details>[/code]To rename a DB, you really need to shutdown the server, rename the actual directory itself, and then handle all the privileges. I don't think there's another way, though I think 5.1 will have a RENAME DATABASE command. 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.