unable to install mysql 5 with ./build mysql

codeman05

Verified User
Joined
Jun 21, 2008
Messages
44
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:
Code:
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?
 
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
 
that helped, but still errors out:

Code:
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'...
[b]/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[/b]
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
 
Last edited:
what happens when you do:

/etc/init.d/mysqld restart
 
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]

I do not see any mysqld processes running however.
 
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.
 
this is what is in that file
Code:
#!/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.
 
Yeah like that.

Now just run:

/etc/init.d/mysqld restart

Then look in /var/log/messages for the errors
 
hmmm...well if the above file is correct...then the log is not showing anything when I run the command
 
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
 
Code:
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
Code:
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
 
See if you have a file /etc/my.cnf. It might be left over from the other install.
 
yes I do, but its the same one I was using prior to this fiasco.

This is also one in:
/etc/mysql/my.cnf
 
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!!
 
Last edited:
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.

Code:
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:

Code:
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?
 
You will have to start mysql in the foreground to see the error more then likely.

You can run mysqld_safe manually.
 
Code:
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 :(
 
Same problem here.

Just installed custombuild with default settings on a clean debian lenny.
Everything seems ok, only this mysql error.
 
I have same problem on Debian 5. Installed custombuild with default settings. Everything works except MySQL.
 
Back
Top