Solved

Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '='

Posted on 2014-01-22
3
566 Views
Last Modified: 2014-01-22
I get the following warning "Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' ".

CREATE TABLE `evenemang` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `resanr` int(11) DEFAULT NULL,
  `datum` date NOT NULL DEFAULT '0000-00-00',
  `titel` varchar(50) DEFAULT NULL,
  `plats` varchar(50) DEFAULT NULL,
  `antal_biljetter` int(11) DEFAULT '0',
  `resa_pris` int(11) DEFAULT '0',
  `antal_frukost` int(11) DEFAULT '0',
  `frukost_pris` int(11) DEFAULT '0',
  `antal_lunch` int(11) DEFAULT '0',
  `lunch_pris` int(11) DEFAULT '0',
  `antal_middag` int(11) DEFAULT '0',
  `middag_pris` int(11) DEFAULT '0',
  `antal_vickning` int(11) DEFAULT '0',
  `vickning_pris` int(11) DEFAULT '0',
  `beskrivning` blob,
  `date` date DEFAULT NULL,
  `time` time DEFAULT NULL,
  `ip` varchar(50) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

boka-1-admin.php

How come?
0
Comment
Question by:lericson
  • 2
3 Comments
 
LVL 34

Expert Comment

by:gr8gonzo
ID: 39799937
Your database probably has a utf8 default charset, and you're trying to define a latin1 character set in your table. Try changing the "DEFAULT CHARSET" part of your statement to use the utf8 character set for the database.
0
 
LVL 34

Accepted Solution

by:
gr8gonzo earned 500 total points
ID: 39799947
If your table is already created and you're getting that error during inserts / updates, then convert your table to utf8:

ALTER TABLE `evenemang` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;

You may need to do this for other tables, too. I'd always recommend using utf-8 over latin1 nowadays.
0
 

Author Closing Comment

by:lericson
ID: 39801795
Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now