• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Can't write arabic text into mysql database using mysql prompt

 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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

 
Don't listen to Steve. Just read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic