[Bug 478904] New: MySQL fails to initialize DB when silly hostname chosen (first execution of /etc/init.d/mysql)
https://bugzilla.novell.com/show_bug.cgi?id=478904 Summary: MySQL fails to initialize DB when silly hostname chosen (first execution of /etc/init.d/mysql) Classification: openSUSE Product: openSUSE 11.1 Version: Final Platform: All OS/Version: openSUSE 11.1 Status: NEW Severity: Normal Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: jo@feuersee.de QAContact: qa@suse.de Found By: --- User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) SUSE A lot of different openSUSE (and other Linux dists or UN*X like systems) related forums have threads like "Can't connect to MySQL" "What's the default password to MySQl" "Can't install MySQL" etc. When trying to reproduce everything went fluid and MySQL is up and running, so WTF are these guys doing wrong? As they state nothing. But: a lot of MySQL depends on a unique well chosen hostname. "If the hostname of the machine is accidentally set to ‘hostname’ or ‘localhost’, it results in a duplicate entry." Yes, it's really stupid to call a machine 'hostname' or even 'localhost' but ppl do that. In this case MySQL will fail to init it's DB and won't allow any access (due to missing DB permissions). Reproducible: Always Steps to Reproduce: 1. 2. 3. Thread in german forum: <http://www.linux-club.de/viewtopic.php?f=36&t=99169> The script /etc/init.d/mysql should check if the hostname is properly set (!= localhost or hostname), fail with a clear message if so (eg. "Unable to continue due to silly hostnane. Please set a proper hostname") -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=478904 User cyhan@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=478904#c1 Chuanye Han <cyhan@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |cyhan@novell.com AssignedTo|bnc-team-screening@forge.pr |mhrusecky@novell.com |ovo.novell.com | --- Comment #1 from Chuanye Han <cyhan@novell.com> 2009-02-26 20:35:09 MST --- Michal, could you please take a look at this bug, please? I am not very sure whether it is right to assign it to you. Thank you very much. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=478904 User mhrusecky@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=478904#c2 Michal Hrusecky <mhrusecky@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P3 - Medium Status|NEW |ASSIGNED --- Comment #2 from Michal Hrusecky <mhrusecky@novell.com> 2009-02-27 00:00:38 MST --- Yes, I'm the right person. I'll take a look at it. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=478904 User mhrusecky@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=478904#c3 Michal Hrusecky <mhrusecky@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |NEEDINFO Info Provider| |jo@feuersee.de --- Comment #3 from Michal Hrusecky <mhrusecky@novell.com> 2009-03-02 10:32:28 MST --- I just tried to reproduce this in 11.1 and I wasn't able to reproduce it using either 'localhost' nor 'hostbame' as a hostname. In both cases I was able to start MySQL (first start after mysql installation with default /var/lib/mysql) basic database structure got installed and I was able to log in. Are you sure this happends just because of hostname? If changing hostname fixes your issue, can you provide your full localhost/hostname hostname (hostname -f)? -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=478904 User jo@feuersee.de added comment https://bugzilla.novell.com/show_bug.cgi?id=478904#c4 --- Comment #4 from Jo Schulze <jo@feuersee.de> 2009-03-04 11:35:40 MST --- I could somehow reproduce problems with "hostname" and no hostname at all, but not with "localhost", and not the "duplicate entry" thing. 0) backup any data if not on a test system 1) stop mysql 2) rm /etc/HOSTNAME (or mv to HOSTNAME_BACK) 3) rm everything from /var/lib/mysql/ except the empty dirs .tmp and .protected 4) reboot (just to make sure that the former hostname isn't cached somewhere) Now the system should come up with no hostname (displayed as "(none)" on the login prompt. Try directly or set the hostname with (none):~ # hostname hostname In a new shell the hostname is properly displayed: hostname:~ # rcmysql start [...] Creating MySQL privilege database... hostname: Unknown host WARNING: The host '' could not be looked up with resolveip. This probably means that your libc libraries are not 100 % compatible with this binary MySQL version. The MySQL daemon, mysqld, should work normally with the exception that host name resolving will not work. This means that you should use IP addresses instead of hostnames when specifying MySQL privileges ! Installing MySQL system tables... ERROR: 1049 Unknown database 'mysql' 090304 18:34:35 [ERROR] Aborting 090304 18:34:35 [Note] /usr/sbin/mysqld: Shutdown complete Installation of system tables failed! Examine the logs in /var/lib/mysql for more information. You can try to start the mysqld daemon with: /usr/sbin/mysqld --skip-grant & and use the command line tool /usr/bin/mysql to connect to the mysql database and look at the grant tables: shell> /usr/bin/mysql -u root mysql mysql> show tables Try 'mysqld --help' if you have problems with paths. Using --log gives you a log in /var/lib/mysql that may be helpful. The latest information about MySQL is available on the web at http://www.mysql.com Please consult the MySQL manual section: 'Problems running mysql_install_db', and the manual section that describes problems on your OS. Another information source is the MySQL email archive. Please check all of the above before mailing us! And if you do mail us, you MUST use the /usr/bin/mysqlbug script! failed hostname:~ # hostname -f hostname: Unknown host hostname:~ # hostname hostname --eof -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=478904 User mhrusecky@novell.com added comment https://bugzilla.novell.com/show_bug.cgi?id=478904#c5 --- Comment #5 from Michal Hrusecky <mhrusecky@novell.com> 2009-03-12 13:37:24 MST --- Created an attachment (id=279242) --> (https://bugzilla.novell.com/attachment.cgi?id=279242) Script to collect data about bug I tried to reproduce this bug but I failed. I'm able to reproduce hostname behavior but not the actual bug. I wrote simple script which tries to reproduce this bug and collect all relevant data. Can you backup your data and try to run this script? It should collect all relevant informations, pack them in one archive and hopefully I'll be able to find out from them whats wrong. How to use it: -1) backup your data 0) prepare computer in state in which MySQL wouldn't install 1) download script and save it somewhere on the disk 2) run it as root (for example su -c 'sh ./mysql_test') 3) when it fails, it will produce /tmp/mysql-bug.tgz file, which will contain hopefully enough informations about this bug 4) if it fails, mail me the resulting file -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com