Bug 5791 - mysql.sock not created; Can't start mysql: error in /etc/init.d/mysqld?
Summary: mysql.sock not created; Can't start mysql: error in /etc/init.d/mysqld?
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: All Linux
Priority: release_blocker critical
Target Milestone: ---
Assignee: Anne Nicolas
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 3342
  Show dependency treegraph
 
Reported: 2012-05-08 08:03 CEST by Doug Laidlaw
Modified: 2012-05-10 20:48 CEST (History)
4 users (show)

See Also:
Source RPM: mariadb
CVE:
Status comment:


Attachments
my.cnf (as installed) (5.33 KB, application/octet-stream)
2012-05-09 04:47 CEST, Doug Laidlaw
Details
Output of "sudo service -d mysqld status" (7.83 KB, text/x-log)
2012-05-09 05:45 CEST, Doug Laidlaw
Details
report.bug.gz from upgrade (389.61 KB, application/x-gzip)
2012-05-09 20:02 CEST, claire robinson
Details

Description Doug Laidlaw 2012-05-08 08:03:01 CEST
Description of problem:


Version-Release number of selected component (if applicable): mariadb 


How reproducible:


Steps to Reproduce:
1.
2.
3.
Installed Mageia Beta 3 from a DVD.  Trying to start mysqld or mysqld_safe crashes consistently.

Running "/etc/init.d/mysqld start" gives reply:

expr: syntax error
./mysqld: line 338: [: : integer expression expected
Starting MySQL: .                                                    [FAILED]

Line 338 reads:

if [ "`get_mysql_id $NEW_VER`" -gt "`get_mysql_id $OLD_VER`" ]; then
        upgrade_message="WARNING: mysql_upgrade should be run (as root). The upgrade from mysql-$OLD_VER to mysql-$NEW_VER may require it."
        echo $echo_n "$upgrade_message"
        logger -p daemon.info -t mysql $upgrade_message
        echo
    fi

Perhaps Mousepad can't count?

I tried to run mysql_upgrade, but it can't start without a socket file.
Thomas Backlund 2012-05-08 09:36:06 CEST

CC: (none) => tmb
Assignee: bugsquad => alien

Comment 1 AL13N 2012-05-08 21:28:31 CEST
what is Mousepad ? could you put set -x before that line and see what $OLD_VER and $NEW_VER evaluate to?
Comment 2 AL13N 2012-05-08 21:31:30 CEST
also, did you change anything in my.cnf ? can you post this too?

also is this reproducable with mageia 2 RC?
AL13N 2012-05-08 21:57:55 CEST

Keywords: (none) => NEEDINFO

AL13N 2012-05-08 21:58:42 CEST

Priority: Normal => High
Source RPM: mysql => mariadb
Severity: normal => major

Comment 3 Manuel Hiebel 2012-05-08 22:16:53 CEST
Start fine here (pre-rc) and under systemd.
Comment 4 Doug Laidlaw 2012-05-09 04:47:37 CEST
Created attachment 2223 [details]
my.cnf (as installed)
Comment 5 Doug Laidlaw 2012-05-09 05:45:16 CEST
Created attachment 2224 [details]
Output of "sudo service -d mysqld status"
Comment 6 AL13N 2012-05-09 08:28:52 CEST
is this the same bug now? i don't see anything which resembles the upgrade message error... or those lines of code which you have shown above...
Comment 7 Doug Laidlaw 2012-05-09 08:42:32 CEST
It is all happening here.  It sounds as though the problem is on my computer.

I was hoping that the error message would show some problem, whether relevant or not.  The last paragraph or so is in red, namely:

+ gprintf FAILED
+ '[' -x /bin/gettext -a -n FAILED ']'
+ '[' -n en_AU.UTF-8 ']'
++ LC_ALL=en_AU.UTF-8
++ LANGUAGE=en_AU:en_GB:en
++ gettext -e --domain=initscripts -- FAILED
+ local TEXT=FAILED
+ '[' FAILED ']'
+ shift
+ printf -- FAILED
FAILED+ '[' color = color ']'
+ echo -en '\033[0;39m'

I still have my old Cauldron installation. I will try it and get back to you.
Comment 8 Doug Laidlaw 2012-05-09 08:50:50 CEST
There is no text on my view of the comments with attachments.  I saved the attachments then saved the whole comment.  Just in case, the old version of mysql was 5.10, the new is 5.5.23-MariaDB.  Mousepad is the text editor for Xfce.
Comment 9 Doug Laidlaw 2012-05-09 09:05:08 CEST
I didn't have the database in my old installation. On a fresh installation of the packages, mysqld started normally.
Comment 10 Doug Laidlaw 2012-05-09 10:08:59 CEST
SOLVED:  I copied the /etc/init.d/mysqld from the new installation across:  No change.

I renamed my /var/lib/mysql directory and copied the new one across: fixed.

Now to get my databases back, but that is my problem.

Thanks for the clues.
Comment 11 AL13N 2012-05-09 13:48:32 CEST
i thought this was a fresh installation, but it's an upgrade from mga1?

i think the trailing -MariaDB could have an effect on the comparison function in that script. can you execute "get_mysql_id 5.5.23-MariaDB" and see what it returns? i think it should return 5.5.23 iinm (without the trailing -MariaDB)
Comment 12 AL13N 2012-05-09 13:51:22 CEST
or is this a fresh install with retaining /var ?
Comment 13 Doug Laidlaw 2012-05-09 14:14:51 CEST
Yes, it was that.  I probably shouldn't.  All I need to keep is /var/www/html and a backup of the databases.  I accept the installer's suggestion to format only / and /usr.

I did try deleting /var/log/mysqld/mysqld.log.  That was a fix I found on a French forum ages ago, but has not been needed for a long time.

"get_mysql_id 5.5.23-MariaDB" returns that there is no such command, for root or user.
Comment 14 AL13N 2012-05-09 14:39:00 CEST
it's likely a helper application or bash function somewhere... i can't check from here, i'll try and check tonight
Comment 15 Doug Laidlaw 2012-05-09 17:12:48 CEST
It may be in a -devel or admin package.  I am running only a local server.

This bug can be closed, but I don't know what fate to assign to it.
Comment 16 AL13N 2012-05-09 17:27:23 CEST
i'd like to keep this one open to see if i can fix it anyway, or if mga1 > mga2 upgrades will actually work...
Comment 17 Doug Laidlaw 2012-05-09 17:59:04 CEST
O.K., I will leave it to you to close when you have finished.  There is no real evidence that it was a bug at all.  Anything could have corrupted my mysql/ directory.  I copied one database back with no problems; all I had to do was set the ownership again.  Intuitively, the error will be outside the databases themselves, but I am not qualified to say that.
Comment 18 AL13N 2012-05-09 19:21:10 CEST
it seemed to me to be a script failure when upgrading database from 5.5.10 to 5.5.23 ... so i'd like to make sure...
Manuel Hiebel 2012-05-09 19:30:43 CEST

Blocks: (none) => 3342

Comment 19 claire robinson 2012-05-09 19:33:49 CEST
After upgrade from mga1 to RC release using the RC DVD 64..

Neither mysqld or mariadb are listed in MCC services.

$ mysqladmin --user=root ping
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!


# ps aux | grep mysql
root      6569  0.0  0.1  18992   880 pts/0    S+   18:23   0:00 grep --color mysql


# service mysqld start
Cannot find mysqld service
Usage: service -[Rfshv] SERVICE ARGUMENTS
	-f|--full-restart:	Do a fullrestart of the service.
	-R|--full-restart-all:	Do a fullrestart of all running services.
	-s|--status-all:	Print a status of all services.
	--ignore-dependencies:  Do not start required systemd services
	--skip-redirect:	Do not redirect to systemd
	-d|--debug:		Launch with debug.
	-h|--help:		This help.


# systemctl status mysqld.service
mysqld.service
	  Loaded: error (Reason: No such file or directory)
	  Active: inactive (dead)


# rpm -q mariadb
package mariadb is not installed


# rpm -qa | grep maria
mariadb-client-5.5.23-4.mga2
mariadb-core-5.5.23-4.mga2
mariadb-common-5.5.23-4.mga2
lib64mariadb18-5.5.23-4.mga2
mariadb-common-core-5.5.23-4.mga2
lib64mariadb-embedded18-5.5.23-4.mga2
claire robinson 2012-05-09 19:34:33 CEST

CC: (none) => eeeemail

Comment 20 AL13N 2012-05-09 19:55:47 CEST
can i get the debug installation logs? i think in /root somewhere
Comment 21 claire robinson 2012-05-09 19:55:59 CEST
# rpm -qa | grep mysql
nagios-check_mysql-1.4.15-8.mga1
mysql-connector-java-5.1.14-2.mga1
qt4-database-plugin-mysql-4.8.1-2.mga2
php-mysql-5.3.12-2.mga2
nagios-check_mysql_query-1.4.15-8.mga1
perl-DBD-mysql-4.20.0-2.mga2
Comment 22 AL13N 2012-05-09 19:59:20 CEST
so it uninstalled mysql and not installed mariadb, arg... not good...
Comment 23 claire robinson 2012-05-09 20:02:11 CEST
Created attachment 2233 [details]
report.bug.gz from upgrade
claire robinson 2012-05-09 20:07:25 CEST

Priority: High => release_blocker
CC: (none) => ennael1
Hardware: i586 => All
Severity: major => critical

Comment 24 claire robinson 2012-05-09 20:08:33 CEST
$ ll /var/lib/mysql
total 28692
-rw-rw---- 1 mysql mysql 18874368 May  9 16:02 ibdata1
-rw-rw---- 1 mysql mysql  5242880 May  9 16:02 ib_logfile0
-rw-rw---- 1 mysql mysql  5242880 May  9 11:49 ib_logfile1
-rw-rw---- 1 mysql root      3284 May  9 16:02 localhost.err
drwxr-xr-x 2 mysql mysql     4096 Apr 28 04:32 mysql/
-rw-r--r-- 1 root  root         7 May  9 11:49 mysql_upgrade_info
drwx------ 2 mysql mysql     4096 May  9 11:48 performance_schema/
drwxr-xr-x 2 mysql mysql     4096 Apr 28 04:32 test/
Comment 25 AL13N 2012-05-09 20:15:59 CEST
it seems the DVD of rc doesn't contain mariadb package...

Keywords: NEEDINFO => (none)
Assignee: alien => ennael1

Comment 26 claire robinson 2012-05-09 20:22:56 CEST
$ ps aux | grep akonadi
claire   15628  0.2  0.6 131888  4836 ?        Sl   19:15   0:00 /usr/bin/akonadi_control
claire   15633  0.2  0.9 1196416 7640 ?        Sl   19:15   0:00 akonadiserver
claire   15680  1.1  9.6 1551548 73540 ?       Sl   19:15   0:04 /usr/sbin/mysqld --defaults-file=/home/claire/.local/share/akonadi/mysql.conf --datadir=/home/claire/.local/share/akonadi/db_data/ --socket=/home/claire/.local/share/akonadi/socket-linux.local/mysql.socket
claire   15765  0.3  3.0 367124 23332 ?        Sl   19:15   0:01 /usr/bin/akonadi_nepomuk_feeder --identifier akonadi_nepomuk_feeder
claire   15766  0.2  2.8 310908 21576 ?        S    19:15   0:00 /usr/bin/akonadi_maildispatcher_agent --identifier akonadi_maildispatcher_agent
claire   15767  0.3  3.4 512228 26716 ?        S    19:15   0:01 /usr/bin/akonadi_mailfilter_agent --identifier akonadi_mailfilter_agent
claire   15773  0.1  2.3 270112 17688 ?        Sl   19:15   0:00 /usr/bin/akonadi_agent_launcher akonadi_contacts_resource akonadi_contacts_resource_0
claire   15796  0.1  2.3 276884 18172 ?        Sl   19:15   0:00 /usr/bin/akonadi_agent_launcher akonadi_ical_resource akonadi_ical_resource_0
claire   15802  0.2  2.3 278672 18256 ?        Sl   19:15   0:00 /usr/bin/akonadi_agent_launcher akonadi_maildir_resource akonadi_maildir_resource_0
claire   15843  0.1  2.3 278672 17976 ?        Sl   19:15   0:00 /usr/bin/akonadi_agent_launcher akonadi_akonotes_resource akonadi_akonotes_resource_0
Comment 27 Doug Laidlaw 2012-05-10 02:13:26 CEST
This may be a different bug.  In the course of my exploring, I found a post with how to use sqlite with akonadi, instead of mysql.  Looking further, I see that it is not recommended, but the original post (which I can't find now) hinted that akonadi was causing the problem.
Comment 28 Doug Laidlaw 2012-05-10 02:41:55 CEST
(In reply to comment #27)
> This may be a different bug.  In the course of my exploring, I found a post
> with how to use sqlite with akonadi, instead of mysql.  Looking further, I see
> that it is not recommended, but the original post (which I can't find now)
> hinted that akonadi was causing the problem.

To elaborate further: my issue was with the database.  An ordinary desktop installation uses mysql, but doesn't have the database installed, or the daemon mysqld.  My Cauldron didn't have mariadb, but ran akonadi quite happily.  One forum message complained that akonadi was using mysqld instead of mysql.  There is an RPM qt4-database-plugin-mysql-4.8.1-2.mga2
Comment 29 AL13N 2012-05-10 20:48:39 CEST
testing the post-rc images, mariadb is on the DVD. it is not enabled by default, but when started, it all works perfectly... closing issue

Status: NEW => RESOLVED
CC: (none) => alien
Resolution: (none) => FIXED


Note You need to log in before you can comment on or make changes to this bug.