Koozali.org: home of the SME Server

Enabling UTF-8 in mysql data base

Offline jumba

  • *****
  • 291
  • +0/-0
  • Donations: July 2007 - $ 20.00
    • Smeserver på svenska!
Enabling UTF-8 in mysql data base
« 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???

Offline CharlieBrady

  • *
  • 6,918
  • +3/-0
Re: Enabling UTF-8 in mysql data base
« Reply #1 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'.

Offline jumba

  • *****
  • 291
  • +0/-0
  • Donations: July 2007 - $ 20.00
    • Smeserver på svenska!
Re: Enabling UTF-8 in mysql data base
« Reply #2 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!


Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Enabling UTF-8 in mysql data base
« Reply #3 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.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline jumba

  • *****
  • 291
  • +0/-0
  • Donations: July 2007 - $ 20.00
    • Smeserver på svenska!
Re: Enabling UTF-8 in mysql data base
« Reply #4 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!

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Re: Enabling UTF-8 in mysql data base
« Reply #5 on: March 01, 2009, 09:04:43 PM »
As promised before, I should report back here after testing.
Thanks for reporting back :)
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)