user3696143 user3696143 - 1 month ago 11
MySQL Question

MySql Database showing ???? for Hindi Fonts

I am trying to save Hindi content in db so for that i made changes in table as well with this query

ALTER TABLE group_distribution CHARACTER SET UTF8;


and when i run this query

SHOW VARIABLES LIKE 'character_set%';


I got below result

character_set_client utf8
character_set_connection utf8
character_set_database latin1
character_set_filesystem binary
character_set_results utf8
character_set_server latin1
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/


What changes i have to made so my DB support other languages too ?

Answer Source

I got the issue ..Issue is related to table definition see below

CREATE TABLE `group_distribution` (
  `gd_id` int(11) NOT NULL,
  `gd_tweet` varchar(500) CHARACTER SET latin1 NOT NULL,
  `gd_ht` varchar(45) CHARACTER SET latin1 DEFAULT NULL,
  `gt_created_by` int(11) DEFAULT NULL,
  `gt_team_lead` int(11) DEFAULT NULL,
  `gt_send_to` int(11) DEFAULT NULL,
  `gt_added_dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `gt_update_dt` timestamp NULL DEFAULT NULL,
  `gt_active_flag` tinyint(1) NOT NULL,
  PRIMARY KEY (`gd_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Here you can check it clearly show gd_tweet` varchar(500) CHARACTER SET latin1 NOT NULL, have diffrent characterset thats why created issue now i changed it to

CREATE TABLE `group_distribution` (
  `gd_id` int(11) NOT NULL,
  `gd_tweet` varchar(500) CHARACTER SET utf8 NOT NULL,
  `gd_ht` varchar(45) CHARACTER SET utf8 DEFAULT NULL,
  `gt_created_by` int(11) DEFAULT NULL,
  `gt_team_lead` int(11) DEFAULT NULL,
  `gt_send_to` int(11) DEFAULT NULL,
  `gt_added_dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `gt_update_dt` timestamp NULL DEFAULT NULL,
  `gt_active_flag` tinyint(1) NOT NULL,
  PRIMARY KEY (`gd_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;