Forum Moderators: coopster
I have problem with charset in my Mysql database.
server 1(localhost):
Mysql version 5 with php5
MySQL charset is UTF-8 Unicode (utf8)
MySQL connection collation - latin2_general_ci
server 2:
Mysql version 4.1.8 php 4.3.10
MySQL charset is UTF-8 Unicode (utf8)
MySQL connection collation - latin2_general_ci
As you can see both servers have same charset configuration, so here can't be any problems.
When i'm trying to dump data from one of the table from my db ( server 2 -> server1) in result mysql gives me strange symbol. For example "£(from polish alphabet) replaced by?".
I'm from Poland so i'm trying to use ISO-8859-2 charset style.
In my PhpMyAdmin configuration file i have:
/* From config.default.php */
$cfg['DefaultCharset'] = 'iso-8859-2';
My apache 2.0 get on well with words like £,¹,¿,Ÿ...
If you can give me some advice(s) please reply for this post.
Best regards
Peter
For any other charset, this will only be true for those characters that are the same as ISO-8859-1. Otherwise, to go from UTF-8 to ISO-8859-* you need to do some sort of conversion. Better yet, try using UTF-8 from start to finish.
I wants to import data (over 1000 records) from server2 to my localhost mysql db(witch is empty, so i can't import vice-versa).
But while i was trying to do (server2 -> server1) i observed that mysql in server1 changed one of my MySQL connection collation - latin2_general_ci to latin1_swedish_ci. I have no idea why. As i already said my server2 have also MySQL connection collation - latin2_general_ci.
CREATE TABLE `kid_prod` (
`id_prod` int(11) NOT NULL auto_increment,
`id_head` int(11) NOT NULL default '0',
`id_s_kat` int(11) NOT NULL default '0',
`id_parent` int(11) NOT NULL default '0',
`title_prod` text NOT NULL,
`desc_prod` text NOT NULL,
`popular_prod` int(11) NOT NULL default '0',
`status_prod` int(11) NOT NULL default '0',
PRIMARY KEY (`id_prod`),
FULLTEXT KEY `title_prod` (`title_prod`),
FULLTEXT KEY `desc_prod` (`desc_prod`)) TYPE=MyISAM AUTO_INCREMENT=684 ;
Maybe i need to put somethings after "TYPE=MyISAM AUTO_INCREMENT=684 "..?
Best regards
Peter
You would specify a charset for a table like this
CREATE TABLE `table1` (
#stuff
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
(obviously changing latin1 to whatever you need).
I had some strange issue with that when changing MySQL versions - tables carried over default charsets that didn't match the desired charset and it created some problems.