Solved

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

Posted on 2014-01-22
3
572 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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

I use MySQL for many of my development projects in a Windows environment. To manage my databases (and perform queries) for years I used a tool called MySQL administrator.  This tool has since been replaced by MySQL Workbench. So I decided to m…
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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