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 6909997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T08:45:34+00:00 2026-05-27T08:45:34+00:00

If I try to search for a value in mysql database and the string

  • 0

If I try to search for a value in mysql database and the string value contains dot in it, query returns 0 rows. Example:

SELECT * FROM table WHERE `username`='marco.polo'  --> 0 rows
SELECT * FROM table WHERE `username` LIKE '%.polo%'  --> 0 rows
SELECT * FROM table WHERE `username` LIKE 'polo'  --> Success

This appeared after moving server and database to another place. I know that dot is a set of extended regular expressions, but it should not apply to equal nor LIKE operator, simply because I don’t use REGEXP in query.

I’ve tested the same query on my local database and it works fine.
Could there be a special setting in mysql that treats dot differently than it usually does?

  • 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-05-27T08:45:35+00:00Added an answer on May 27, 2026 at 8:45 am

    user1084605, I tried to replicate the problem (using MySQL version 5.1.37), but got exactly the opposite results as you. See below:

    mysql> create table test (username varchar(100));
    Query OK, 0 rows affected (0.01 sec)
    
    mysql> insert into test values ('marco.polo');
    Query OK, 1 row affected (0.00 sec)
    
    mysql> SELECT * FROM test WHERE `username`='marco.polo';
    +------------+
    | username   |
    +------------+
    | marco.polo | 
    +------------+
    1 row in set (0.00 sec)
    
    mysql> SELECT * FROM test WHERE `username` LIKE '%.polo%';
    +------------+
    | username   |
    +------------+
    | marco.polo | 
    +------------+
    1 row in set (0.00 sec)
    
    mysql> SELECT * FROM test WHERE `username` LIKE 'polo';
    Empty set (0.00 sec)
    

    According to the MySQL docs, the only special characters when using the LIKE operator are “%” (percent: matches 0, 1, or many characters) and “_” (underscore: matches one and only one character).
    http://dev.mysql.com/doc/refman/5.0/en/string-comparison-functions.html

    A “.” (period) does have special meaning for MySQL’s REGEXP operator, but it should still match a literal period in your column.
    http://dev.mysql.com/doc/refman/5.0/en/regexp.html

    Can you replicate the SQL statements I ran above and paste your results in reply?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to search a string starting with the slash / character in
I am using the below code to search a mysql database but cannot get
I have a query that, basically, says this: SELECT DISTINCT [DB_ID] FROM [TableX] WHERE
I'm try to create a query which will search four different tables with one
The Vector find function can search an inserted value even if you try and
I try to find a part of a search word in a string variable
In MYSQL, from a pure performance perspective, if I have a table with large
I want to build a mySQL query, which returns all nodes in a graph
I have a query similar to this: SELECT itemID FROM itemTable WHERE itemID LIKE
I have an XML document that I load in and try to search with

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.