O'Reilly logo

Sams Teach Yourself MySQL by Chris Newman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Altering a Database

The ALTER DATABASE statement enables you to change the characteristics of an existing database. Its syntax is the same as the syntax of the CREATE DATABASE statement, and any CHARACTER SET or COLLATE specification changes the behavior of an existing database.

For example, suppose you want to change greekdb to use the ASCII character set. You would issue the following command:

mysql> ALTER DATABASE greekdb
    -> CHARACTER SET ascii;
Query OK, 1 row affected (0.00 sec)

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required