Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8289359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:29:28+00:00 2026-06-08T12:29:28+00:00

In MySQL, my database’s and my table’s collate are utf8_persian_ci. This specific collation, unlike

  • 0

In MySQL, my database’s and my table’s collate are utf8_persian_ci. This specific collation, unlike utf8_general_ci, considers same weight for “1”,”2″,”3″,… and “۱”,”۲”,”۳”,… (the latter is Persian number format). The same weight means that in the search query both Persian and Latin formats should be returned. Although my database, table and even collation_server (I defined it in my.cnf) are utf8_persian_ci, my search query doesn’t return both Persian and Latin numbers:

Table:

 --------
|  col   |
|--------|
|   1    |
|--------|
|   ۱    |
----------

(The col type is varchar)

Query:

SELECT * FROM my_tbl tbl where tbl.col like "1"

Results:

 --------
|  col   |
|--------|
|   1    |
|--------|

I found that the following query returns my desired results:

SELECT * FROM my_tbl tbl where tbl.col like "1" collate utf8_persian_ci

Which returns:

 --------
|  col   |
|--------|
|   1    |
|--------|
|   ۱    |
----------

My first problem is that I can’t figure out why do I have to write collate utf8_persian_ci although the default collation of MySQL server and database are utf8_persian_ci.

My second problem is that the application I’m working on is using JPA. So the queries I’m writing are JPQL which doesnt support collate utf8_persian_ci.
I need an equivalence code to collate utf8_persian_ci in JPQL or maybe I should configure MySQL to not use collate utf8_persian_ci at the end of my query and get the sepecified result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T12:29:29+00:00Added an answer on June 8, 2026 at 12:29 pm

    It’s possible that whilst the default collations of the server, database and table are utf8_persian_ci, such defaults have been overridden by the definition of the column itself.

    You can force the desired collation on the column; for example:

    ALTER TABLE my_tbl MODIFY col VARCHAR(123) COLLATE utf8_persian_ci
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL database table called Participant that looks something like this: (idParticipant)
So my MySQL database is behaving a little bit wierd. This is my table:
In mysql database i have this column called: Name: Date Type: datetime I have
I have a MySQL database where the table was set up to store the
In mysql database table I have integer field, what i want to find missing
My MysQL database contains multiple MyISAM tables, with each table containing millions of rows.
I have a MySQL database table that contains an Article ID ( primary key
I have a MySQL database table called submission with a field called points with
I'm reading a MySQL database where a table has bid, ask, price_datetime (where price_datetime
PHP mysql database I have created a follow on question to this one here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.