co.ador Posted December 15, 2009 Share Posted December 15, 2009 need to change the Server Characterset, Db Characterset And Client Characterset From latin1 to utf8 Does any body has an idea on how to do it on mysql console? Thank you Link to comment https://forums.phpfreaks.com/topic/185167-how-can-i-change-the-characterset-in-mysql-console/ Share on other sites More sharing options...
corbin Posted December 15, 2009 Share Posted December 15, 2009 To set the connection to use UTF8, you can simply do a query like: SET NAMES utf8; If you want to set UTF8 as the default, you'll have to do some tinkering in my.conf (or my.ini or whatever it's called). I'm sure you can find the variable name by googling. As for setting a table character set: CREATE TABLE sometable ( field1 varchar(255) CHARSET=UTF8 ); (You might have to do "CHARACTER SET UTF8" instead of CHARSET....) Or: CREATE TABLE sometable ( field1 varchar(255) ) CHARSET=UTF8; As for the default on that, I'm sure it's another my.cnf option. Link to comment https://forums.phpfreaks.com/topic/185167-how-can-i-change-the-characterset-in-mysql-console/#findComment-977484 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.