PDA

View Full Version : unable to install mysql 5 with ./build mysql



codeman05
04-03-2009, 09:09 AM
well I fubared this one.
Installed a package through apt-get and didn't notice that it also installed mysql-common. Needless to say this hosed the directadmin install of mysql.

I've removed mysql-common and am now trying to reinstall mysql with custombuild.

However I get this error:


Stopping mysqld ...
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
Giving mysqld a few seconds to start up...
./bin/my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2)
Fatal error in defaults handling. Program aborted
./bin/my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2)
Fatal error in defaults handling. Program aborted
/usr/local/mysql/bin/mysql_upgrade: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2)
Fatal error in defaults handling. Program aborted
/usr/local/mysql/bin/mysqlcheck: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2)
Fatal error in defaults handling. Program aborted
Restarting MySQL.
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
It is recommended to do "./build php n" after MySQL update.
./bin/my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2)
Fatal error in defaults handling. Program aborted
./bin/my_print_defaults: Can't read dir of '/etc/mysql/conf.d/' (Errcode: 2)
Fatal error in defaults handling. Program aborted


Any ideas on how i can get around this?

scsi
04-03-2009, 09:12 AM
mkdir -p /etc/mysql/conf.d

you should do:

rpm -qa | grep -i mysql

to make sure you dont have any other mysql stuff installed.

Then reinstall again:

cd /usr/local/directadmin/custombuild
./build update
./build clean
./build mysql d

codeman05
04-03-2009, 09:14 AM
that helped, but still errors out:



root@shodan/pts/0:/usr/local/directadmin/custombuild> ./build mysql
Stopping mysqld ...
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
Giving mysqld a few seconds to start up...
Looking for 'mysql' as: /usr/local/mysql/bin/mysql
Looking for 'mysqlcheck' as: /usr/local/mysql/bin/mysqlcheck
Running 'mysqlcheck'...
/usr/local/mysql/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed
/usr/local/mysql/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
Restarting MySQL.
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
It is recommended to do "./build php n" after MySQL update.


This is Debian btw.

Thanks for the help

scsi
04-03-2009, 09:39 AM
what happens when you do:

/etc/init.d/mysqld restart

codeman05
04-03-2009, 09:42 AM
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]

I do not see any mysqld processes running however.

scsi
04-03-2009, 09:45 AM
Your gonna have to edit /etc/init.d/mysqld and add --log-error=/var/log/messages to the start command line. Then after trying to start mysqld again you can check /var/log/messages for what the error might be.

codeman05
04-03-2009, 09:49 AM
this is what is in that file


#!/bin/sh

DB_DIR=/usr/local/mysql/data
PIDFILE=${DB_DIR}/`/bin/hostname -s`.pid
PROGNAME=mysqld

case "$1" in
start)
cd /usr/local/mysql
if [ -x /usr/local/mysql/bin/mysqld_safe ]; then
/usr/local/mysql/bin/mysqld_safe --log-error=/var/log/messages --user=mysql --datadir=${DB_DIR} --pid-file=${PIDFILE} > /dev/null &
if [ $? -ne 0 ]
then
echo -e 'Starting mysqld:\t\t[ FAILED ]'
else
echo -e 'Starting mysqld:\t\t[ OK ]'
fi
fi
;;
stop)
if [ -f ${PIDFILE} ]; then
/bin/kill `cat ${PIDFILE}` > /dev/null 2>&1 && echo -e "Stopping mysqld:\t\t[ OK ]"
else
echo -e "Stopping mysqld:\t\t[ FAILED ]"
fi
;;
restart)
$0 stop
$0 start
;;
status)
status $PROGNAME
;;
*)
echo ""
echo "Usage: `basename $0` { start | stop | restart }"
echo ""
exit 64
;;
esac


Where do I add the log information?
Sorry, this is getting above my skill level.

scsi
04-03-2009, 10:00 AM
Yeah like that.

Now just run:

/etc/init.d/mysqld restart

Then look in /var/log/messages for the errors

codeman05
04-03-2009, 10:04 AM
hmmm...well if the above file is correct...then the log is not showing anything when I run the command

scsi
04-03-2009, 10:07 AM
Ugh maybe it didnt have permissions to that file.

You can try running the server manually.

See what happens if you run the following command:

/usr/local/mysql/bin/mysqld_safe --user=mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/mysql.pid

codeman05
04-03-2009, 10:09 AM
root@shodan/pts/0:/usr/local/directadmin/custombuild> /usr/local/mysql/bin/mysqld_safe --user=mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/mysql.pid
090403 12:00:41 mysqld_safe Logging to '/usr/local/mysql/data/shodan.ainsworthsolutions.com.err'.
090403 12:00:41 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
090403 12:00:42 mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql.pid ended


/usr/local/mysql/data/shodan.ainsworthsolutions.com.err shows


090403 12:02:17 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
090403 12:02:17 [Warning] The syntax '--log_slow_queries' is deprecated and will be removed in MySQL 7.0. Please use '--slow_query_log'/'--slow_query_log_file' instead.
090403 12:02:17 [ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg.sys'
090403 12:02:17 InnoDB: Started; log sequence number 0 181026690
090403 12:02:17 [ERROR] /usr/local/mysql/bin/mysqld: unknown option '--skip-bdb'
090403 12:02:17 [ERROR] Aborting

090403 12:02:17 InnoDB: Starting shutdown...
090403 12:02:18 InnoDB: Shutdown completed; log sequence number 0 181026690
090403 12:02:18 [Warning] Forcing shutdown of 1 plugins
090403 12:02:18 [Note]
090403 12:02:18 mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql.pid ended

scsi
04-03-2009, 10:11 AM
See if you have a file /etc/my.cnf. It might be left over from the other install.

codeman05
04-03-2009, 10:12 AM
yes I do, but its the same one I was using prior to this fiasco.

This is also one in:
/etc/mysql/my.cnf

codeman05
04-03-2009, 10:19 AM
haha got it!!!!


Looks like the apt-get fiasco caused MySQL to look for /etc/mysql/my.cnf instead of /etc/my.cnf
Just did a symlink back to the correct cnf file and now everything is back up.


I knew it was going to be something obvious I was missing =/

Thanks for the help scsi!!

Manie
05-15-2009, 08:35 AM
I would like to bump this topic, I seem to have the same problem.
Debian 5, however no pre-installed mysql. (Everything trough custombuild)

I started installing mysql 5.1.

However after wanted to switch back to 5.0 I'm doubting if I have ruined some things.


server:/usr/local/directadmin/custombuild# ./build mysql d
Stopping mysqld ...
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
Giving mysqld a few seconds to start up...
Looking for 'mysql' as: /usr/local/mysql/bin/mysql
Looking for 'mysqlcheck' as: /usr/local/mysql/bin/mysqlcheck
Running 'mysqlcheck'...
/usr/local/mysql/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysql.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed
/usr/local/mysql/bin/mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysql.sock' (2) when trying to connect
Restarting MySQL.
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
It is recommended to do "./build php n" after MySQL update.


And the server never seems to get up:


server:/usr/local/directadmin/custombuild# /etc/init.d/mysqld restart
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
terrait1:/usr/local/directadmin/custombuild# /etc/init.d/mysqld restart
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
server:/usr/local/directadmin/custombuild#


Anyone got a clue?
Perhaps both mysql5.0 and 5.1 are conflicting in some way?

scsi
05-15-2009, 08:51 AM
You will have to start mysql in the foreground to see the error more then likely.

You can run mysqld_safe manually.

Manie
05-15-2009, 09:17 AM
server:/tmp# ps aux | grep mysql

root 2716 0.0 0.0 2620 1180 ? S 16:39 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --user=mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/terrait1.pid

mysql 2880 0.0 1.3 372104 44036 ? Sl 16:39 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --log-error=/usr/local/mysql/data/terrait1.err --pid-file=/usr/local/mysql/data/terrait1.pid --socket=/tmp/mysql.sock --port=3306

root 3135 0.0 0.0 3116 716 pts/0 R<+ 17:00 0:00 grep mysql


I however never get a mysql.sock file :(

Manie
05-15-2009, 09:57 AM
well i disabled the back in options.conf and switched back to mysql5.0 and now it seems to be working. n/m :)

betz
06-23-2009, 01:27 AM
Same problem here.

Just installed custombuild with default settings on a clean debian lenny.
Everything seems ok, only this mysql error.

flatron
06-26-2009, 12:02 PM
I have same problem on Debian 5. Installed custombuild with default settings. Everything works except MySQL.

Arieh
08-04-2010, 06:59 PM
I was just being very stupid to play with apt-get and mysql related stuff and broke my mysql.

Maybe for future reference:

- if you have an --skip-bdb or other error, it could mean that you have config file for a different mysql version. I found a skip bdb setting in /etc/mysql/my.cnf, which shouldn't be in a mysql 5.1 config file.

- try and see if /etc/mysql/my.cnf is the same as /etc/my.cnf, if not your probably want to make a symlink: ln -s /etc/my.cnf /etc/mysql/my.cnf (given that /etc/mysql/my.cnf was wrong and /etc/my.cnf has a newer config file without those error causing settings)

- Errors are displayed in an .err file, /home/mysql/yourservername.tld.err for example