how to change character set
hi,
I'm using 4.1.3b with mysql-max. Currently I've developed an application which is using the db on 4.1.3 in latin1 character set. Am going to localize the application to japanese. Therefore hoping to use 'sjis' as the new character set. Need to know the process of tranforming my aleady existing database from latin1 to sjis step by step.
I can use ALTER TABLE for this thing. but I'm confused with how to use this character sets properly. In the manuals it mentions about server charater set, connection charater set, client character set , etc... can u direct me to an example in sql, probably a db backup example where it is using 'sjis' properly. I tried with only setting the character sets "sjis" only for tables and it didn't work properly. When i enter some jap chars to the db it shows as ?????. Also when retrieving i only get ????. What's the mistake i've done?
here am putting a part of the backup from my db. I have only remove some CREATE TABLEs and kept only one of them.
SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
SET NAMES utf8;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE=NO_AUTO_VALUE_ON_ZERO */;
CREATE DATABASE /*!32312 IF NOT EXISTS*/ `pdmdb`;
USE `pdmdb`;
CREATE TABLE `personal_selling` (
`record_id` int(10) NOT NULL auto_increment,
`user_id` varchar(255) character set latin1 NOT NULL default '',
`selling_done` tinyint(1) NOT NULL default '0',
`selling_date` date NOT NULL default '0000-00-00',
`client_name` varchar(100) character set latin1 NOT NULL default '',
`client_company` int(10) default NULL,
`item_name` varchar(100) character set latin1 NOT NULL default '',
`item_amount` int(11) NOT NULL default '0',
`item_price` decimal(10,2) NOT NULL default '0.00',
`total_price` decimal(10,2) NOT NULL default '0.00',
`payment_date` date default NULL,
`shipped_date` date default NULL,
`remarks` text character set latin1,
PRIMARY KEY (`record_id`),
KEY `user_id` (`user_id`),
KEY `client_company` (`client_company`),
CONSTRAINT `personal_selling_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `personal_data` (`user_id`) ON UPDATE CASCADE,
CONSTRAINT `personal_selling_ibfk_2` FOREIGN KEY (`client_company`) REFERENCES `company_data` (`company_id`)
) ENGINE=InnoDB DEFAULT CHARSET=sjis;
/*-------
/*more here
/*-------
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
thnx in advance,
Lasantha