Ramaraja
Ramaraja

Reputation: 2626

How to enter the Indian Rupee symbol in MySQL Server 5.1?

I am unable to find the exact solution for MySQL

Upvotes: 5

Views: 9926

Answers (3)

Rohit Parte
Rohit Parte

Reputation: 4076

Simplest way to do it is, utf8mb4 stores all the symbols

 ALTER TABLE AsinBuyBox CONVERT TO CHARACTER SET utf8mb4;

Upvotes: 1

Ajit Singh
Ajit Singh

Reputation: 390

The thing is the column supports by default UTF-8 encoding which consists of 3 bytes. The Indian Rupee Symbol, since it is new has a 4 byte encoding. So we have to change the character encoding to utf8_general_ci by,

ALTER TABLE test_tb MODIFY COLUMN col VARCHAR(255)
    CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL;

After executing the above query simply execute the following query to insert the symbol,

insert into test_tb values("₹");

Ta-Da!!!

Upvotes: 17

Rick James
Rick James

Reputation: 142560

You are talking Oracle, yet it is tagged MySQL. Which do you want? And what language and/or client tool are you using?

Copy and paste it. Which Rupee do you like? ৲ ৳ ૱ ௹ ₨ ꠸

Probably you want this one: UNHEX('E282A8') = '₨' which is U+20A8 or 8360 in non-MySQL contexts

You need to have CHARACTER SET utf8 on the table/column.

You need to have done SET NAMES utf8 (or equivalent) when connecting.

Upvotes: 1

Related Questions