Sunday, October 14, 2012


How to store UTF character in Mysql 

1. jdbc:mysql://localhost:3306/testedb2?createDatabaseIfNotExist=true&useUnicode=true&characterEncoding=UTF-8&useServerPrepStmts=false

2. 
Create mysql table for storing other languages. 


create table klargenews.finalnews
(
      clusterid int,
      category varchar(200),
      clusterrank decimal(30,28),
      articleid varchar(200),
      newstime timestamp,
      category_count int,
      title text,
      text text,
      url varchar(1000),
      imgurl varchar(1000)
)ENGINE=MyISAM AUTO_INCREMENT=1740 DEFAULT CHARSET=utf8;


Change column type

alter table testedb2.crawl change batchid batchid text;

Change latin to Uft type 

ALTER TABLE testedb2.webpage  CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

No comments:

Post a Comment