Tutorial: creating the database

On most database systems it will be enough to execute the following statement from the console or any other SQL execution facility:

CREATE DATABASE drake;

If you would like to execute this statement from within PHP, you can create a small PHP file and run it through your browser:

<php
	$db = mysql_connect(...);
	mysql_query('CREATE DATABASE drake');
?>

Database encodings

You are invited to check that your database is using the Unicode UTF-8 collation for the Drake CMS database; Drake CMS uses internally and externally this encoding and using it in the database will prevent encoding corruption.

To set the default encoding as UTF8, use

...

If you are using MySQL, you can convert your database's tables encodings to UTF8 using the following PHP snippet:

$d_dbname = 'drake; // your database name here
mysql_query("ALTER DATABASE `$d_dbname` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci");
$res = mysql_query("SHOW TABLES FROM `$d_dbname`");
while($row = mysql_fetch_row($res)) {
	$query = "ALTER TABLE {$d_dbname}.`".current($row)."` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci";
	mysql_query($query);
	$query = "ALTER TABLE {$d_dbname}.`".current($row)."` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci";
	mysql_query($query);
}