Save Data in Arabic in MySQL database(在 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 ....
这篇关于在 MySQL 数据库中保存阿拉伯语数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:在 MySQL 数据库中保存阿拉伯语数据
基础教程推荐
- SQL Server 2016更改对象所有者 2022-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01