将阿拉伯语数据保存在 MySQL 数据库中
我已经更改了表和列的字符集,我得到的阿拉伯文本为???? MYSQL 数据库中的标记
是表的设计
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;
当我再次触发选择查询时,它显示????作为文本?
谁能告诉我我哪里做错了?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
将阿拉伯语数据手动插入到您的 Phpmyadmin 中。
首先检查您的数据库、表和列名称是否设置为 utf8。
如果这些未设置为 utf8,那么首先设置它,然后您可以将阿拉伯数据插入到数据库表中。
您可以通过查看下面的示例来检查每一项。
对于数据库:
对于表:
对于列:
如果您使用 SQLYog,您可以轻松地将 utf8 设置为表。
只需右键单击数据库、表、列名称,然后单击更改选项并设置为
数据库图表集 = utf8
数据库排序规则 = utf8_general_ci 。
只是享受....
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:
For Tables:
For Columns:
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 ....
要使用 php 正确读取、写入和排序 mysql 数据库中的阿拉伯文本,请确保:
MySQL 字符集:UTF-8 Unicode (utf8)
MySQL连接排序规则:
utf8_general_ci
您的数据库和表排序规则设置为:
utf8_general_ci
或utf8_unicode_ci
然后,添加当您连接到数据库时,您的 php 脚本中的此代码:
了解更多详情
To read ,write and sort Arabic text in mysql database using php correctly, make sure that:
MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation:
utf8_general_ci
your database and table collations are set to:
utf8_general_ci
orutf8_unicode_ci
Then, add this code in your php script when you connect to db:
For more details
我们可以使用以下查询将数据库或 db 表转换为 uft8 支持:
希望有帮助!
阅读更多内容@
https://kb.mediatemple。 net/questions/138/Default+MySQL+character+set+and+collation#gs
http://hollyslog.com/technology/how-to -存储阿拉伯语或希伯来语字符-mysql-数据库
We can convert database or db table to uft8 supportive with below query:
Hope it helps !
Read More @
https://kb.mediatemple.net/questions/138/Default+MySQL+character+set+and+collation#gs
http://hollyslog.com/technology/how-to-store-arabic-or-hebrew-characters-mysql-database
将数据库表排序规则类型更改为
utf8_general_ci
,并将表字段排序规则更改为utf8_general_ci
。Change the database tables collations types to
utf8_general_ci
and also table fields collations change toutf8_general_ci
.确保您的客户端软件也使用 UTF-8。
http://dev.mysql.com/doc/refman/5.0 /en/charset-connection.html
Make sure that your client software is also using UTF-8.
http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html
试试这个代码:
Try this code :
配置配置 = new Configuration();
// characterEncoding=UTF-8 at "jdbc:mysql://localhost:3306/alizidan?useSSL=false&characterEncoding=UTF-8" 工作得非常好
Configuration configuration = new Configuration();
// characterEncoding=UTF-8 at "jdbc:mysql://localhost:3306/alizidan?useSSL=false&characterEncoding=UTF-8" work VERY GOOD