phpmysql error – #1273 – #1273 – Unknown collation: ‘utf8mb4_general_ci’

This solution worked for me 1) Click the “Export” tab for the database 2) Click the “Custom” radio button 3) Go the section titled “Format-specific options” and change the dropdown for “Database system or older MySQL server to maximize output compatibility with:” from NONE to MYSQL40. 4) Scroll to the bottom and click “GO”. If … Read more

MySQL: Get character-set of database or table or column?

Here’s how I’d do it – For Schemas (or Databases – they are synonyms): SELECT default_character_set_name FROM information_schema.SCHEMATA WHERE schema_name = “mydatabasename”; For Tables: SELECT CCSA.character_set_name FROM information_schema.`TABLES` T, information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA WHERE CCSA.collation_name = T.table_collation AND T.table_schema = “mydatabasename” AND T.table_name = “tablename”; For Columns: SELECT character_set_name FROM information_schema.`COLUMNS` WHERE table_schema = “mydatabasename” AND table_name … Read more

Microsoft.Jet.OLEDB.4.0 Converting Characters

Finally! Thanks to @HABJAN I was able to get to the resolution which is as simple as setting the CharacterSet in the Extended Properties of the connection string. For my situation it was UTF-8… commonly used by default in PHPMyAdmin which is where my data was retrieved from. Resulting working connection string: “Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\”{0}\”;Extended Properties=\”text;HDR=Yes;FMT=Delimited;CharacterSet=65001;\”” … Read more

SQL Query Where Column = ” returning Emoji characters 🎃 and 🍰

This is collation dependant. Matches empty string SELECT 1 where N” = N’🍰’ COLLATE latin1_general_ci_as Doesn’t match empty string SELECT 1 WHERE N” = N’🍰’ COLLATE latin1_general_100_ci_as The 100 collations are more up-to-date (though still not bleeding edge, they have been available since 2008) and you should use more modern collations unless you have some … Read more

store arabic in SQL database

You need to choose an Arabic collation for your varchar/char columns or use Unicode (nchar/nvarchar) CREATE TABLE #test ( col1 VARCHAR(100) COLLATE Latin1_General_100_CI_AI, col2 VARCHAR(100) COLLATE Arabic_CI_AI_KS_WS, col3 NVARCHAR(100) ) INSERT INTO #test VALUES(N’لا أتكلم العربية’,N’لا أتكلم العربية’,N’لا أتكلم العربية’) Note the N before values in insert statement above. If you do not mention it, … Read more