Remove Invalid or Non-ASCII Characters from MySQL database

4 minutes read

How can I find non-ASCII characters in MySQL?

non-ascii

 

Query to find data as  “ASCII”,

Query to find the “Non ASCII ”

How to replace Non ASCII character into table using query

Now in first step create alias column and copy/update data to new column for the backup.

Now in second run the below column to remove Non ASCII characters :).

Sometimes Noticed that characters like “(” or “)” were in the link. So we made another query to replace special characters in alias column.

 

Facebook Twitter LinkedIn Telegram Whatsapp

Related Posts:

If you want to strip line feeds, carriage returns, and tabs you can use: $string = preg_replace('/[\x00-\x1F\x80-\x9F]/u', '', $string); 1 $string = preg_replace('/[\x00-\x1F\x80-\x9...
How to manage international languages in MySQL database using php ? If you want to store multiple languages like Arabic, French, Hindi or Urdu to your MySQL database, default settings is not valid to do that to insert all languages in database. If you insert ...
“How to Export MySQL data to Excel in PHP ?” This script will used to export data into .xls format from mysql database.You need to just copy this code and update database connection details. Below code will export mysql data into excel (.xls format) with ever...