Solved

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

Posted on 2014-01-22
3
582 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 35

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 35

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

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

691 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