| HomeContactSite Map |
![]() | Advanced Web Stats | |
User Guide |
The external database Advanced Web Stats use should be configured to use the same character set as Advanced Web Stats does. Advanced Web Stats is currently using Unicode UTF-8 and this is the recommended encoding to be used for the external database.
If the database is not created yet, please visit the External Database configuration guide to find instructions on how to install and configure the external database.
But to configure the external database character encoding follow the steps outlined below for each type of database.
| Important | |
|---|---|
|
Please note that when changing the database character encoding it's recommended to first backup your database, just in case anything wrong happens. |
To change the database encoding from latin1 to utf-8, follow the steps outlined below.
First, you need to dump the database to a text file using the mysqldump. To dump the database, enter the following command in the command line:
mysqldump -p --default_character-set=latin1 -u root --skip-set-charset aws > awsbackup.sql
Now, copy the awsbackup.sql file to awsbackup-utf8.sql
Using a text editor change the character sets from "latin1" to "utf-8".
Using Recode (http://recode.progiciels-bpi.ca/), encode all the latin1 characters as UTF-8.
Now, use the mysql client to connect to the server as the MySQL root user and create the 'aws' database with binary UTF-8 collation:
shell> mysql -u root -p
When you are connected to the server use the following commands to drop your existing [aws] database and create a new database with binary UTF-8 collation:
mysql> DROP DATABASE aws; mysql> CREATE DATABASE aws CHARACTER SET utf8 COLLATE utf8_bin;
Finally, import the UTF-8 text file to the new database.
mysql -u root -p --default-character-set=utf8 --max_allowed_packet=64M aws < awsbackup-utf8.sql
Before proceeding update your PostgreSQL database to UTF-8, backup data using SQL dump. Backup your database using the following commands.
pg_dump aws > awsbackup;
To create a PostgreSQL database with binary UTF-8 collation use the following command:
CREATE DATABASE aws WITH ENCODING 'UNICODE';
Finally, to restore the backup of your database, use the following commands:
pg_dump aws < awsbackup;
If you carefully followed the steps outlined on this page you should successfully be able to change the character encoding for MySQL and PostreSQL.
