We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,703 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

problem inserting arabic text into mysql database form mysql command prompt

Hi experts, I have a problem which is I can't write arabic text as values of table , here is the steps I have done , please help me and correct me if I am mistaken

this is what I did:
**************************************************
set names utf8 COLLATE utf8_general_ci;

create database see;

use see;

ALTER DATABASE see CHARACTER SET utf8 COLLATE utf8_general_ci;

create table one (name varchar(20) ) default charset utf8;
ALTER TABLE one CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;
ALTER TABLE one MODIFY name TEXT CHARACTER SET utf8 COLLATE utf8_general_ci;

insert into one(name)
values("عÙÙ");
**********************************************************************************

everything works fine , this is what appear to me when I press status:
**********************************************************************************
Connection id: 12
Current database: see
Current user: root@localhost
SSL: Not in use
Using delimiter: ;
Server version: 5.1.49-community MySQL Community Server (GPL)
Protocol version: 10
Connection: localhost via TCP/IP
Server characterset: latin1
Db characterset: utf8
Client characterset: utf8
Conn. characterset: utf8
TCP port: 3306
Uptime: 9 hours 40 min 53 sec

Threads: 1 Questions: 106 Slow queries: 0 Opens: 32 Flush tables: 1 Open ta
bles: 1 Queries per second avg: 0.3
**********************************************************************************

so when I do insert command and write the arabic text , it appears unaderstandable word and is saved like that , why!!! , is it because mysql prompt doesn't support arabic language , or I miss something .

this is what appear to me , at the end , after inserting the values:

ERROR 1366 (HY000): Incorrect string value: '\xE3\xE9\xEF' for column 'name' at
row 1

please tell me how I could write arabic text into database from command prompt , where is my mistake???

thanks in advance

2
Contributors
1
Reply
5 Days
Discussion Span
2 Years Ago
Last Updated
2
Views
alsoumhi
Junior Poster in Training
66 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

Inserting arabic text from command prompt can't be achieved (as far as I know).
Try using PhpMyAdmin ...

MindSter
Junior Poster in Training
92 posts since Aug 2010
Reputation Points: 11
Solved Threads: 14
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page generated in 0.0962 seconds using 2.71MB