我正在尝试将我母语(Sinhala)中的数据插入到我的mysql表中。但MySQL
将我的字符显示为问号。
这是我测试它的方式:
CREATE DATABASE sinhala_test;
USE kindheart;
ALTER DATABASE sinhala_test
CHARACTER SET utf8
COLLATE utf8_general_ci
CREATE TABLE IF NOT EXISTS `category` (
`category_id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name_si` VARCHAR(100) COLLATE utf8_unicode_ci NOT NULL,
`description_si` TEXT COLLATE utf8_unicode_ci NOT NULL,
`last_update` TIMESTAMP NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`category_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
INSERT INTO `category` VALUES (1,'පොත් පත් සහ පාසල් උපකරණ','නවතම පොත් පත් අවශ්යතා ඇතුළු සියළුම පාසැල් හා අධ්යාපන මෙවලම්.',NOW());
这是我可以从MySQL命令行获得的:
mysql> select * from category\G
*************************** 1. row ***************************
category_id: 1
name_si: ???? ??? ?? ????? ?????
description_si: ???? ??????? ????/ ?????? ?? ?? ???? O/L, A/L ??????? ?????, ???????, ??????? ????? ?????? ???? ??? ????????. ????/???????/???????????/??????/?????? ????/ ????/????/?????? ????? ?????? ?????? ?? ???????? ??????.
last_update: 2018-05-20 11:11:20
有谁能告诉我如何解决这个问题?
NOTE:
从phpMyAdmin
插入正确的工作时。