mysql schema 保存数据,在MySQL数据库中以阿拉伯语保存数据

I have changed the charset of the tables and of the column, i get the arabic text as ???? marks in MYSQL database

here is the design of the table

CREATE DATABASE mydb

DEFAULT CHARACTER SET utf8

DEFAULT COLLATE utf8_general_ci;

CREATE TABLE `categories` (

`category_id` tinyint(2) NOT NULL auto_increment,

`category_name` varchar(50)character set utf8 NOT NULL ,

PRIMARY KEY (`category_id`)

insert into `mydb`.`categories`

(`category_id`, `category_name`)

values (1,'کتگوری');

commit;

When I again fire select query it shows ???? as text?

Can anyone tell me where am i doing wrong?

解决方案

To insert Arabic Data manually into your Phpmyadmin.

First you check either your database , table and column name is utf8 set or not.

If these are not set to utf8 then first you set it then you may insert arabic data into you db table.

YOU MAY CHECK EACH OF THESE BY LOOKING BELOW EXAMPLE.

For Database:

SELECT default_character_set_name FROM information_schema.SCHEMATA S

WHERE schema_name = "schemaname";

For Tables:

SELECT CCSA.character_set_name FROM information_schema.`TABLES` T,

information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA

WHERE CCSA.collation_name = T.table_collation

AND T.table_schema = "schemaname"

AND T.table_name = "tablename";

For Columns:

SELECT character_set_name FROM information_schema.`COLUMNS` C

WHERE table_schema = "schemaname"

AND table_name = "tablename"

AND column_name = "columnname";

You may easily set utf8 to your tables if you are using SQLYog.

Just right click on db, table, column name and click on alter option and set to

Database Chartset = utf8

Database Collation = utf8_general_ci .

Just Enjoy ....

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值