Make MySQL Database Changes with the ALTER Query

Part of the PHP & MySQL For Dummies Cheat Sheet

The ALTER query is used to change the structure of a MySQL database. This list shows the syntax for the changes you are most likely to want to make:

ADD colname definition
ALTER colname SET DEFAULT value
ALTER colname DROP DEFAULT
CHANGE colname newcolname definition
DROP colname
MODIFY colname definition
RENAME newtablename
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Advertisement

Inside Dummies.com