running mysql 5 and php 5
i need to have mysql run as utf-8. Problem is that there are a number of sites on the server that are older and still using latin-1.
is there a way to enable mysql to use utf-8 on a per-site basis?
running mysql 5 and php 5
i need to have mysql run as utf-8. Problem is that there are a number of sites on the server that are older and still using latin-1.
is there a way to enable mysql to use utf-8 on a per-site basis?
It may help:
http://webscholar.net/2008/02/19/database-collation/
Thanks. I already did that. It didn't help, so I upgraded to mysql 5. That didn't help, so here I am![]()
How can I have cpanel create databases with a default charset of utf8 and collation of utf8_unicode_ci?
Nevermind, I figured this out.
Add this line to your my.cnf file
default-character-set=utf8
Amazingly simple really.
I would like to change mysql default charset for some user and I know that I sould be able to do that with .my.cnf file in user's home dir but I just can't get that to work. Whatever I put there it's just ignored.
Can someone please help with this?
That file is only used by the mysql command line client. For connects via PHP, or other programming language, the change needs to happen during the connection. The details will vary according to language and application.
Now, if you mean to influence the cPanel functions, our functions only use the user, host and password values in that file.
I am not shure that I understood... So there is no way to change default database character set that will be created by cPanel per user only.
I would just like that cPanel or Fantastico create a database with utf8 character set as default just for some users.
Is that possible?
Thanks.
I would also like to do this. Is it possible to set the default charset to utf8 and not have it overwritten by updates from cpanel?
Set the default encoding and collation in /etc/my.cnf, then restart the mysql service.
Thanks, Kenneth!
for those looking for recent info for mysql 5.1.x,
I added this to etc/my.cnf
[mysqld]
collation_server=utf8_unicode_ci
character_set_server=utf8
After saving and restarting mysql service, I went create a new database using Fantastico (Joomla 1.5 install), and it was now in the proper uft8 format.
Have your own Personal Web Address yet? GetMyFamilyName.com
On this forum nobody needs Professional Website Management, but I put this for silly PR - SevenSages.com
To better organize related discussions I have merged a few different threads that pertain to the same topic about setting a default character set and or default collation in MySQL.
Last edited by cPanelDon; 08-26-2010 at 05:36 PM. Reason: Correction of typo
cPResources: Submit a Support Request - Submit a Bug Report - Review existing Tickets-- Donald cPanelDon Holl - Analyst, cPanel Quality Assurance
Sorry for bumping this up, but i have a question. If i add collation_server=utf8_unicode_ci and character_set_server=utf8 to my.cnf in order to change charset and collation for new databases will there be any problems with databases already created as latin1?
Actually, I'm going to revise my prior entry as it might pose an issue to have different character sets for different MySQL databases if the character set hasn't been hard coded for the older databases. It would be better to convert the older databases to the new character set if possible. There is a good article on converting the character set for an existing database at this location:
http://codex.wordpress.org/Convertin...Character_Sets
Next, please ensure you are running MySQL 5.1 if you are using those variables.
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Forums Technical Analyst, cPanel Tech Support
Submit a ticket | Check an existing ticket