Koozali.org: home of the SME Server

Contribs.org Forums => General Discussion => Topic started by: jumba on February 28, 2009, 10:13:45 AM

Title: Enabling UTF-8 in mysql data base
Post by: jumba on February 28, 2009, 10:13:45 AM
Hello all!

I'm doing some tests with vtiger on SME Server, and realize that I need the mysql data base to use UTF-8.

Somehow, it doesn't seem to do that when I create the data base using the following commands:

Code: [Select]
[root@sme #] mysql -u root
> create database vtiger_db;
> grant all privileges on vtiger_db.* to 'vtigercrm'@'localhost' identified by 'PASSWORD';
> flush privileges;
> quit
[root@sme #]

Which command should I add to enable UTF-8???
Title: Re: Enabling UTF-8 in mysql data base
Post by: CharlieBrady on February 28, 2009, 03:04:41 PM
Somehow, it doesn't seem to do that when I create the data base using the following commands:

Code: [Select]
[root@sme #] mysql -u root
> create database vtiger_db;
> grant all privileges on vtiger_db.* to 'vtigercrm'@'localhost' identified by 'PASSWORD';
> flush privileges;
> quit
[root@sme #]

Which command should I add to enable UTF-8???

   CREATE DATABASE vtiger DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

I found that by googling for 'mysql create db utf8'.
Title: Re: Enabling UTF-8 in mysql data base
Post by: jumba on February 28, 2009, 03:06:40 PM
Thank you Charlie, - I found lots of other much more complicated strings when I Googled :???:

I'll try this and report back how it turns out!

Title: Re: Enabling UTF-8 in mysql data base
Post by: cactus on February 28, 2009, 03:18:49 PM
I'll try this and report back how it turns out!
Is should work as that is the basic MySQL command to create databases in UTF8 format, you could also have found this in the online MySQL manuals with a little effort as this is not a SME Server specific problem. The MySQL manuals are very extensive and good and give you a lot of information on MySQL.
Title: Re: Enabling UTF-8 in mysql data base
Post by: jumba on March 01, 2009, 08:24:11 PM
As promised before, I should report back here after testing.

It simply works :smile:

Thanks again for the assistance!
Title: Re: Enabling UTF-8 in mysql data base
Post by: cactus on March 01, 2009, 09:04:43 PM
As promised before, I should report back here after testing.
Thanks for reporting back :)