MySQL does not start with utf8 options

Bug #958120 reported by hyper_ch
40
This bug affects 8 people
Affects Status Importance Assigned to Milestone
mysql-5.5 (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

I'm trying to run mysql with UTF8 defaults.

For that reason I added to the [client] section in /etc/mysql/my.cnf:

default-character-set=utf8

and to the [mysqld] section

default-character-set=utf8
default-collation=utf8_general_ci
character-set-server=utf8
collation-server=utf8_general_ci
init-connect='SET NAMES utf8'

However when I add the utf8 settings to the mysqld section mysql refuses to restart. It just seems to hang on the start process. In Debian Squeeze the same settings work just fine.

I'm using Kubuntu 12.04 Beta and MySQL is mysql Ver 14.14 Distrib 5.5.20, for debian-linux-gnu (x86_64) using readline 6.2

mysql-server:
  Installed: 5.5.20-0ubuntu3
  Candidate: 5.5.20-0ubuntu3
  Version table:
 *** 5.5.20-0ubuntu3 0
        500 http://ch.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

lsb_release -rd
Description: Ubuntu precise (development branch)
Release: 12.04

Tags: bot-comment
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/958120/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This bug did not have a package associated with it, which is important for ensuring that it gets looked at by the proper developers. You can learn more about finding the right package at https://wiki.ubuntu.com/Bugs/FindRightPackage . I have classified this bug as a bug in mysql-server-5.5.

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://help.ubuntu.com/community/ReportingBugs.

affects: ubuntu → mysql-5.5 (Ubuntu)
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in mysql-5.5 (Ubuntu):
status: New → Confirmed
Revision history for this message
Michael Ludwig (michaellud) wrote :

I'm just trying to setup a new TYPO3 instance on a freshly installed VM system Ubuntu precise x64.
After appending this line:

: default-character-set=utf8

in my.cnf (in [mysqld] sect) the mysql server doesn't start anymore. The goal was to get the tables created by the TYPO3 installer in collation utf8_general_ci instead of utf8_swedish_ca.

This worked in 10.04.

What can be done to get this working in 12.04?
Why doesn't the mysql server start anymore when adding this line?

Michael

Revision history for this message
Florian Diesch (diesch) wrote :

default-character-set has been remove in mysql 5.5.3. Use character-set-server instead.

Revision history for this message
hyper_ch (bugs-launchpad-net-roleplayer) wrote :

Florian:

Well, this was on 5.5.20 and not 5.5.3

Revision history for this message
Michael Ludwig (michaellud) wrote :

To me this one is cleared. It was a wrong collation in the database. Deleting the user, it's db and recreating it solved the problem. I took these settings in my.cnf:

init_connect='SET collation_connection = utf8_general_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_general_ci
skip-character-set-client-handshake

Revision history for this message
Tom Fotherby (a-launchpad-tomfotherby-com) wrote :
Revision history for this message
James (james-ellis-gmail) wrote :

ran into this issue in a 12.04 upgrade, my conf is spread across include files based on usage.

I had this for 5.1 (note the two server settings):

/etc/mysql/conf.d$ cat charset.cnf
[mysqld]
collation-server = utf8_unicode_ci
character-set-server = utf8
default-character-set=utf8

[client]
default-character-set=utf8

sudo mysql service start - this would hang until sending a Ctrl+C

Changing to this allowed mysql to start, I guess the client entry is Ok.

/etc/mysql/conf.d$ cat charset.cnf
[mysqld]
collation-server = utf8_unicode_ci
character-set-server = utf8

[client]
default-character-set=utf8

Bit of a tough one, It's possible mysql (the vendor) issued notices about deprecated configuration but it would be good if the service start would not hang and instead issue a warning and die with log messages so a sysadmin knows what's happening.

I checked logs (syslog, mysql error log) and nothing showed up, thinking AppArmor was the issue - which has happened before - I uninstalled that to test but no cigar. Reinstalled and the same issue.

If you hit this issue in a 12.04 upgrade, try out the charset conf change above.

Revision history for this message
Clint Byrum (clint-fewbar) wrote :

Can somebody who is affected please attach /var/log/mysql* to the bug report? Also just type 'sudo /usr/sbin/mysqld' and paste the output. Its not clear to me what exactly is failing, but I do think the fail is probably logged somewhere.

Revision history for this message
Hobson Lane (hobs) wrote :

All `sudo mysqld` gives is:

    120813 7:28:50 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
    120813 7:28:50 [ERROR] Aborting
    120813 7:28:50 [Note] /usr/sbin/mysqld: Shutdown complete

/var/log/mysql.err and tail /var/log/mysql.log are empty because mysqld fails to start (for my version of this problem).

syslog has:

Aug 13 07:22:29 AlSSD kernel: [ 1898.934344] init: mysql main process (5335) terminated with status 1
Aug 13 07:22:29 AlSSD kernel: [ 1898.934403] init: mysql main process ended, respawning
Aug 13 07:22:30 AlSSD kernel: [ 1899.947461] init: mysql post-start process (5336) terminated with status 1
Aug 13 07:22:30 AlSSD kernel: [ 1899.984589] init: mysql main process (5363) terminated with status 1
Aug 13 07:22:30 AlSSD kernel: [ 1899.984649] init: mysql main process ended, respawning
Aug 13 07:22:31 AlSSD kernel: [ 1900.997748] init: mysql post-start process (5364) terminated with status 1
Aug 13 07:22:31 AlSSD kernel: [ 1901.027165] init: mysql main process (5391) terminated with status 1
Aug 13 07:22:31 AlSSD kernel: [ 1901.027185] init: mysql respawning too fast, stopped

Because my original failure started with a syslog about apparmor deny, I disabled apparmor with `sudo service apparmor teardown`, but that left me with the messages above during the failed starts.

Could be related to the fact that for me / (where mysqld would load from) is mounted on an an SSD, but /var, /home, and /tmp (where presumably mysqld would create database files) are on an HD.

Revision history for this message
Ivan Borzenkov (ivan1986) wrote :

why not add by default utf8
and debian sleep more 5 years
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=321505

Revision history for this message
Morgan Tocker (morgo) wrote :

I think this sounds like a reasonable feature request to track with upstream. I've filed: http://bugs.mysql.com/bug.php?id=71659

Revision history for this message
hyper_ch (bugs-launchpad-net-roleplayer) wrote :

default utf-8 would be good IMHO.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.