Hi,
Just tried to update from 4.6.0 to 4.7 beta 4.
I get the following errors messages :
Warning: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_general_ci,IMPLICIT) for operation 'like'
query: SELECT * FROM access WHERE status = 1 AND type = 'host' AND LOWER('127.0.0.1') LIKE LOWER(mask) in c:\documents and settings\thierry\mes documents\sitesweb\drupal-4.7.0-beta4\includes\database.mysql.inc on line 124
Warning: Illegal mix of collations (utf8_general_ci,COERCIBLE) and (latin1_general_ci,IMPLICIT) for operation 'like'
query: SELECT * FROM access WHERE status = 0 AND type = 'host' AND LOWER('127.0.0.1') LIKE LOWER(mask) in c:\documents and settings\thierry\mes documents\sitesweb\drupal-4.7.0-beta4\includes\database.mysql.inc on line 124
Use this script to upgrade an existing Drupal installation.
This kind of messages didn't occur when I tested the beta 3.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | drupal-4.6-4.7-mysql-convert.php.txt | 4.01 KB | mr700 |
Comments
Comment #1
bryan kennedy commentedI am also having this same problem, although running the database update script had no problems. But when I try and access the site nothing hapens. If I look at my error logs I see this:
Looks like a conflict between the previous database collation of latin1_swedish_ci and the new UTF-8. I have not idea how to fix this though. I am using MySQL 4.1.9-standard.
Comment #2
Bèr Kessels commentedThis 'bug' has hit almost everyone. Leaving this 'critical' bacause we are going to be swamped with bug reports and annoyed people if we do not fix this.
Yes, they are only warnings, but it looks very nasty.
Would documenting this in update.php be an option?
Comment #3
bryan kennedy commentedWell, I was able to come up with a quick personal sollution for this issue. I just did a DUMP of my SQL and then found and replaced the latin for UTF in the charset. Then when I reimported it into MySQL drupal didn't have any more problems. Is there some way the update script can change the collation of all the fields in your SQL?
Comment #4
dopry commentedHere are some examples of charset conversion in SQL... for mysql.
http://dev.mysql.com/doc/refman/4.1/en/charset-conversion.html
Comment #5
gregglesI marked http://drupal.org/node/47730 as a duplicate of this issue.
Also, I'd say that this should not be "critical". It will generate lots of forum messages if it isn't fixed, but there is a known workaround.
Comment #6
greg_y commentedI posted this in http://drupal.org/node/46564#comment-93374; sorry if I am showing my newbie-ness by also posting here.
I got the character encoding message upgrading from a hosted 4.6.3 database to 4.7 CVS as of 2006-02-12. I was not able to lsubsequently log into the site.
For people upgrading an existing database: what worked for me was exporting the 4.6 database using phpMyAdmin, but under the Structure settings, set "SQL export compatability" to MySQL40. This has the effect of removing “DEFAULT CHARSET=latin1” from many of the CREATE TABLE statements in the export file. When I imported this cleansed structure and data into my new empty database for 4.7, the subsequent upgrade worked flawlessly.
There must be a way to do this with straight SQL code, bypassing phpMyAdmin, but I don't know enough to make that work.
This issue also appears in bug report http://drupal.org/node/46424 and in the beta 4 announcement http://drupal.org/node/46564#comment-93374 .
Comment #7
handelaar commentedI'm really not following this.
Can't we just @suppress warnings for these queries if there's no actual bug and forget about it?
Comment #8
kzeng commentedI attempted to update my current drupal powered site and found that three tables failed to be updated ( accesslog, node, locales_target). Afater updating, the only problem I found is the display of the forum titles. The encoding seems to be messed up. So when they are listed in the forum, the titles were not displayed properly. But the title displayed at the top of the post had no problem at all. So i don't know what's wrong. Maybe it is related to the mix of illegal character problem.
Comment #9
kzeng commentedI tried again. If I just updated to beta-3, then everything went well and there is no problem. But if I contitue to update my website to beta-4, then the three updating failure appeared (as I mentioned above) and the tiltes of the forum posts are messed up. So the prolem is caused by beta-4.
Comment #10
moshe weitzman commentedupdate is still possible, just shows warnings. downgrading.
Comment #11
jbrauer commentedUnfortunately it does more than show warnings. It makes the upgraded Drupal unusable.
At the very least this seems a critical documentation bug. I just used CVS (yesterday's which looks to be identical to B5) and upgraded a site. There are no warnings and things seem to "work". That is until you try to log in. The installation insists your user name or password is wrong and there is no way to have it changed as it won't recognize the email address either. At the very least it seems some stern warning about this should appear in UPGRADE.txt and possibly be a warning displayed to users in update.php.
Comment #12
dries commentedJosh, thanks for your follow-up. What makes you believe that your problem is related to this issue? I'd like to understand. Such information would help us address this issue.
Comment #13
Mayday commentedThis is still a problem with beta5. I used both the mysqli and mysql driver. The update.php did not take care of it and it should be referenced in the update.php help or displayed better in the handbook. I think this is rather critical because I work with databases and knew what to do and the solutions. If Drupal wants to be marketed well as a CMS solution, it needs to be easy to use and upgrade. Food for thought.
Comment #14
ciric@drupal.org commentedI tried the following:
Import database.mysql
Try using Druapl: error as listed before.
Then go to Database view in phpsqlmyadmin.
Choose Operations (last tab on the right , the view is server>servername database > databasename)
Choose utf_general_ci in Collation (last lin, third "Go" button)
This wll show up the output:
ALTER DATABASE `web4unit78011` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
Then go back to the Be sure also to have the same collation in the Server page.
Drop allthe tables
Now do the import again
It worked up to now.
Perhaps there is an easier way, I don't know.
Comment #15
anj commentedOuch. I just hit this bug. I've been running the DRUPAL-4-7 branch from CVS and I just upgraded (it's about 2 weeks since the last
cvs update). When I tried to login the DB lookup failed with the same error concerning mixing collations on the user table. I found a fix here in the form of this operation:The problem may be because I upgraded my MySQL database recently (3.23->4.1) and perhaps did not transfer the data correctly. Could the upgrade script check the encoding of all the tables and alter them? Or would this MySQL ALTER command completely break non-latin1 characters?
Comment #16
benc commentedI have the same problem BUT i am starting from a fresh installation of Drupal (that is, I am not upgrading from an old one).
Comment #17
benc commentedI used PHPMyAdmin to install the Drupal DB and I've since fixed the error.
Solution:
From a fresh install, when pasting the SQL commands in the SQL textarea of PHPMyAdmin (from file database.4.1.mysql), make sure you click the dropdown box for character set and choose utf8_general_ci
Comment #18
geshan commentedHelp me facing the same problem.
Comment #19
liquidcms commentedi just moved my site from my local server (mysql 4.1) to a host that only had mysql 4.0 and 5.. so i went with 5.
I started to get the warnigns listed above and tried the solution listed in #15 above... did tables one by one until warnings stopped; ended up modifying:
access, category, user, category_node
now i have no warnings.. BUT.. even thuogh i can log into site.. as soon as i do a refresh i am logged out again.. maybe this is a different issue though.
20 sites with db and email accounts galore + massive server crash = VERY long night...
Comment #20
zjune commentedI also faced this problem using drupal 4.7.4, and searching forum for hours,and fixed it finally like following:
1.creat the database in phpadmin
2.run the sql:
ALTER DATABASE `yourdatabasename` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci
3.Then import database.mysql
and then just follow the installation instruction as drupal desribed
you can see my demo site:
Drupal Demo Site
Comment #21
mr700 commentedI made a script when I migrated my 4.6 sites to 4.7. I'll attach it here in hope it helps someone (not the finest piece of code, but worked for me).
Comment #22
jbrauer commented