Using JavaScript to perform text matches with/without accented characters

There is a way to ““deaccent” the string being compared” without the use of a substitution function that lists all the accents you want to remove… Here is the easiest solution I can think about to remove accents (and other diacritics) from a string. See it in action: var string = ‘Ça été Mičić. ÀÉÏÓÛ’; … Read more

Illegal mix of collations error in MySql

Here’s how to check which columns are the wrong collation: SELECT table_schema, table_name, column_name, character_set_name, collation_name FROM information_schema.columns WHERE collation_name=”latin1_general_ci” ORDER BY table_schema, table_name,ordinal_position; And here’s the query to fix it: ALTER TABLE tbl_name CONVERT TO CHARACTER SET latin1 COLLATE ‘latin1_swedish_ci’; Link

A script to change all tables and fields to the utf-8-bin collation in MYSQL

Can be done in a single command (rather than 148 of PHP): mysql –database=dbname -B -N -e “SHOW TABLES” \ | awk ‘{print “SET foreign_key_checks = 0; ALTER TABLE”, $1, “CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci; SET foreign_key_checks = 1; “}’ \ | mysql –database=dbname & You’ve got to love the commandline… (You might … Read more

How to fix a collation conflict in a SQL Server query?

You can resolve the issue by forcing the collation used in a query to be a particular collation, e.g. SQL_Latin1_General_CP1_CI_AS or DATABASE_DEFAULT. For example: SELECT MyColumn FROM FirstTable a INNER JOIN SecondTable b ON a.MyID COLLATE SQL_Latin1_General_CP1_CI_AS = b.YourID COLLATE SQL_Latin1_General_CP1_CI_AS In the above query, a.MyID and b.YourID would be columns with a text-based data … Read more

Illegal mix of collations (utf8mb4_unicode_ci,IMPLICIT) and (utf8mb4_general_ci,IMPLICIT) for operation ‘=’

I am guessing you have different collations on the tables you are joining. It says you are using an illegal mix of collations in operations =. So you need to set collation. For example: WHERE tableA.field COLLATE utf8mb4_general_ci = tableB.field Then you have set the same collations on the = operation. Since you have not … Read more

Doing a join across two databases with different collations on SQL Server and getting an error

You can use the collate clause in a query (I can’t find my example right now, so my syntax is probably wrong – I hope it points you in the right direction) select sone_field collate SQL_Latin1_General_CP850_CI_AI from table_1 inner join table_2 on (table_1.field collate SQL_Latin1_General_CP850_CI_AI = table_2.field) where whatever

Discover collation of a MySQL column

You could use SHOW FULL COLUMNS FROM tablename which returns a column Collation, for example for a table ‘accounts’ with a special collation on the column ‘name’ mysql> SHOW FULL COLUMNS FROM accounts; +———-+————–+——————-+——+—–+———+———-+ | Field | Type | Collation | Null | Key | Default | Extra | +———-+————–+——————-+——+—–+———+———-| | id | int(11) | … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)