Debian 5 Mysql 5.0 to 5.1 Upgrade [ERROR]

panosru

Verified User
Joined
Oct 8, 2006
Messages
80
Location
Greece
server:/usr/local/directadmin/custombuild# ./build mysql d
Dumping database admin_avtzis
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database admin_billing
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database admin_ehost
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database admin_jcontact
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database admin_portal
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database admin_projects
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database arisj_bjj
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database da_roundcube
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database gameplanet_yasoo
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database mysql
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database nestoridis_shop
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database test
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database tsantek_tsantek
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database xtremegr_jom
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database yiouhou_blog
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database yiouhou_portal
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Dumping database zaxaro_wines
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) when trying to connect
Stopping mysqld ...
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 '/tmp/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 '/tmp/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.
server:/usr/local/directadmin/custombuild# netstat -lnp |grep mysql
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 12552/mysqld
unix 2 [ ACC ] STREAM LISTENING 38755 12552/mysqld /tmp/mysql.sock
server:/usr/local/directadmin/custombuild# /etc/init.d/mysqld restart
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
server:/usr/local/directadmin/custombuild# ps aux | grep mysql
root 12483 0.0 0.0 3896 1288 pts/0 S 03:51 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --log-error=/var/log/messages --user=mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/server.pid
mysql 12552 0.0 0.9 102964 18708 pts/0 Sl 03:51 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --log-error=/var/log/messages.err --pid-file=/usr/local/mysql/data/server.pid
root 12723 0.6 0.0 3892 1284 pts/0 S 03:57 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --log-error=/var/log/messages --user=mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/server.pid
mysql 12788 0.0 0.5 65960 10712 pts/0 Sl 03:57 0:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --log-error=/var/log/messages.err --pid-file=/usr/local/mysql/data/server.pid
root 12802 0.0 0.0 3116 716 pts/0 S+ 03:58 0:00 grep mysql

This is the error that I'm getting everytime I try to upgrade to MySQL 5.1. I read all posts related to this issue in this forum but nothing helped.

I run some commands so they maybe help you guys on helping me solve this issue :)

I have two my.cnf files one is located on /etc/my.cnf and the other is located on /etc/mysql/my.cnf how ever i renamed the one under /etc/mysql to my.cnf.bk and created a symbolic there so now I have a symbolic link /etc/mysql/my.cnf that is poiting to /etc/my.cnf.

The contents of my.cnf are:
Code:
[mysqld]
local-infile=0

My "mysql.sock" is under /tmp folder but I'm getting the error that says that it cannot connect through /tmp/mysql.sock...

/var/log/messages does not contain any error related to mysql.

/home/mysql/server.topsrv.com.err have this in the error log:

Code:
090704  3:40:12  InnoDB: Starting shutdown...
090704  3:40:13  InnoDB: Shutdown completed; log sequence number 0 263626315
090704  3:40:13 [Warning] Forcing shutdown of 1 plugins
090704  3:40:13 [Note] 
090704 03:40:13 mysqld_safe mysqld from pid file /usr/local/mysql/data/server.pid ended
090704 03:42:35 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
090704  3:42:35 [ERROR] Can't find messagefile '/usr/share/mysql/english/errmsg.sys'
/usr/local/mysql/bin/mysqld: Unknown error 1146
090704  3:42:35 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
090704  3:42:35  InnoDB: Started; log sequence number 0 263626315
090704  3:42:35 [ERROR] /usr/local/mysql/bin/mysqld: unknown option '--skip-bdb'
090704  3:42:35 [ERROR] Aborting

090704  3:42:35  InnoDB: Starting shutdown...
090704  3:42:37  InnoDB: Shutdown completed; log sequence number 0 263626315
090704  3:42:37 [Warning] Forcing shutdown of 1 plugins
090704  3:42:37 [Note] 
090704 03:42:37 mysqld_safe mysqld from pid file /usr/local/mysql/data/mysql.pid ended

On /usr/local/mysql/data/ there isn't any server.pid and mysql.pid files.
The folder /usr/share/mysql does not exist, only the mysql-common is under /usr/share

Hope these help... :)
 
Also when I'm trying to start mysqld service I'm getting the following error:

Code:
server:/usr/local/directadmin/conf# /etc/init.d/mysqld start
Starting mysqld:		[ OK ]
server:/usr/local/directadmin/conf# nohup: redirecting stderr to stdout

And it hangs there
 
When I'm starting mysqld service from my DA control panel (with Capri skin, I don't think that this has any matter but I'm just saying it) I'm getting the error message "An error has occurred" on /var/log/messages I'm getting the following lines after mysqld start:

Code:
090705 02:31:33  mysqld started
090705  2:31:34  InnoDB: Started; log sequence number 0 264657098
090705  2:31:34 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.0.81'  socket: '/tmp/mysql.sock'  port: 3306  MySQL Community Server (GPL)


After this I logged into terminal to check if mysqld is actually running:
server:~# ps xua | grep -i mysql | grep -v grep
root 3091 0.0 0.0 2832 1320 ? S 02:31 0:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --log-error=/var/log/messages --user=mysql --datadir=/usr/local/mysql/data --pid-file=/usr/local/mysql/data/server.pid
mysql 3121 1.0 1.2 105528 26096 ? Sl 02:31 0:03 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data --user=mysql --pid-file=/usr/local/mysql/data/server.pid --skip-external-locking --socket=/tmp/mysql.sock


It seems that it started properly but why DA returns error?

I attach some screenshots on this post.
 

Attachments

  • Picture 8.jpg
    Picture 8.jpg
    21 KB · Views: 344
  • Picture 9.jpg
    Picture 9.jpg
    65.9 KB · Views: 464
I tried to upgrade again mysql but even if i have set mysql=5.1 on options.conf I got a non working Client API version 5.0.51a :/

And PhpMyAdmin returns "#2002 - The server is not responding (or the local MySQL server's socket is not correctly configured)"

I set /usr/local/directadmin/custombuild/options.conf back to mysql=5.0 and works now but I would like to have MySQL v5.1 if anyone could give me any time on this I would appreciate it although I cannot figure it out why it does not work... It should to...

The strange part is that it downloaded MySQL 5.1.35 (2009-07-05 03:38:07 (522 KB/s) - `mysql-5.1.35-linux-i686.tar.gz' saved [121541613/121541613]) but when I installed it phpinfo() returned "Client API version 5.0.51a" this is very strange although I didn't recompile PHP after installing MySQL it should returned the right version of MySQL which was 5.1.35.

So i reinstalled MySQL 5.0 again...
server:/usr/local/directadmin/custombuild# ./build mysql
Dumping database admin_avtzis
Dumping database admin_billing
Dumping database admin_ehost
Dumping database admin_jcontact
Dumping database admin_portal
Dumping database admin_projects
Dumping database arisj_bjj
Dumping database da_roundcube
Dumping database gameplanet_yasoo
Dumping database mysql
Dumping database nestoridis_shop
Dumping database test
Dumping database tsantek_tsantek
Dumping database xtremegr_jom
Dumping database yiouhou_blog
Dumping database yiouhou_portal
Dumping database zaxaro_wines
--2009-07-05 03:46:08-- http://files.directadmin.com/services/all/mysql/debian/mysql-5.0.81-linux-i686.tar.gz
Resolving files.directadmin.com... 72.35.85.222
Connecting to files.directadmin.com|72.35.85.222|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 124303504 (119M) [application/x-gzip]
Saving to: `mysql-5.0.81-linux-i686.tar.gz'

71% [======================================================================================================================================================================> ] 89,033,284 514K/s eta 68s ^100%[=========================================================================================================================================================================================================================================>] 124,303,504 510K/s in 3m 58s

2009-07-05 03:50:06 (511 KB/s) - `mysql-5.0.81-linux-i686.tar.gz' saved [124303504/124303504]

Stopping mysqld ...
Stopping mysqld: [ OK ]
Starting mysqld: [ OK ]
Giving mysqld a few seconds to start up...
nohup: redirecting stderr to stdout
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 '/tmp/mysql.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed
Restarting MySQL.
Stopping mysqld: [ FAILED ]
Starting mysqld: [ OK ]
It is recommended to do "./build php n" after MySQL update.
server:/usr/local/directadmin/custombuild# nohup: redirecting stderr to stdout

Now phpinfo() returns Client API version 5.0.81 and MySQL works on the server.
 
Last edited:
Try:
Code:
killall mysqld
killall -9 mysqld
/etc/init.d/mysqld start
 
Hello smtalk,

Yes I tried it already this does not solve the problem that produced on ./build mysql when I set options.conf to mysql=5.1 :/

Code:
server:~# killall mysqld
server:~# killall -9 mysqld
mysqld: no process killed
server:~# /etc/init.d/mysqld start
Starting mysqld:		[ OK ]
server:~# nohup: redirecting stderr to stdout

Note this is with MySQL 5.0 not with 5.1.

When I set mysql=5.1 in options.conf of directadmin's custombuild and run ./build mysql then after it finish I get a non working MySQL version 5.0.51a

EDIT:
Just tried it again:
server:~# cd /usr/local/directadmin/custombuild
server:/usr/local/directadmin/custombuild# pico options.conf
server:/usr/local/directadmin/custombuild# ./build mysql
Dumping database admin_avtzis
Dumping database admin_billing
Dumping database admin_ehost
Dumping database admin_jcontact
Dumping database admin_portal
Dumping database admin_projects
Dumping database arisj_bjj
Dumping database da_roundcube
Dumping database gameplanet_yasoo
Dumping database mysql
Dumping database nestoridis_shop
Dumping database test
Dumping database tsantek_tsantek
Dumping database xtremegr_jom
Dumping database yiouhou_blog
Dumping database yiouhou_portal
Dumping database zaxaro_wines
Stopping mysqld ...
Stopping mysqld: [ OK ]
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 '/tmp/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 '/tmp/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.
server:/usr/local/directadmin/custombuild#

DA returned: "The service 'mysqld' on server server.example.tld is currently down"

I tried to start it manualy:

server:/usr/local/directadmin/custombuild# /etc/init.d/mysqld start
Starting mysqld: [ OK ]

after that I rebuild PHP and now I'm getting MySQL version 5.1.35 (finally at least I got the right version....)
phpinfo() on mysql section retuned:
mysql

Code:
MySQL Support	enabled
Active Persistent Links	0
Active Links	0
Client API version	5.1.35
MYSQL_MODULE_TYPE	external
MYSQL_SOCKET	/tmp/mysql.sock
MYSQL_INCLUDE	-I/usr/local/mysql/include
MYSQL_LIBS	-L/usr/local/mysql/lib -lmysqlclient

domain that have been set on this server didn't worked so I rebooted the server just in case and still domains does not work... (I'm checking this right now)

EDIT2:
From DA services I see that Mysqld service is stoped even after server's restart and domains that have been set on this server does not work.

I tried to run mysqld service manually
Code:
server:~# /etc/init.d/mysqld start
Starting mysqld:		[ OK ]
server:~# killall mysqld
mysqld: no process killed
server:~# killall -9 mysqld
mysqld: no process killed
server:~# /etc/init.d/mysqld start
Starting mysqld:		[ OK ]

it seems that it started but DA still shows that is stoped. I tried to kill every mysqld service but as you can see ther isn't any mysqld service that runs even if start returned [OK]

I have flagged mysqld with --log-error=/var/log/messages but I don't see any error log there. although I run "ps xua | grep -i mysql | grep -v grep"

Code:
server:~# perl -pi -e 's/\/usr\/local\/mysql\/bin\/mysqld_safe --user/\/usr\/local\/mysql\/bin\/mysqld_safe --log-error=\/var\/log\/messages --user/' /etc/init.d/mysqld
server:~# /etc/init.d/mysqld start
Starting mysqld:		[ OK ]
server:~# ps xua | grep -i mysql | grep -v grep
server:~# /etc/init.d/mysqld start
Starting mysqld:		[ OK ]
server:~# /etc/init.d/mysqld start
Starting mysqld:		[ OK ]
server:~# ps xua | grep -i mysql | grep -v grep
server:~#

Ok cool, I found that a my.cnf file located on /etc/mysql/ produced a conflict so I renamed it to my.cnf.bk just in case I will need it. Then I run the following commands and mysqld service started :)

Code:
server:~# /etc/init.d/mysqld start
Starting mysqld:		[ OK ]
server:~# ps -e | grep mysqld
16899 pts/0    00:00:00 mysqld_safe
16967 pts/0    00:00:00 mysqld

But domain names still not working, I don't know why yet, I restarted the server just in case... hope it will solve the problem... but it didn't... The only domain that works is the one that I'm using on my nameservers. All other domains returns me "Safari can’t open the page."

One thing that I saw on phpinfo() is this:

Code:
mysqli

MysqlI Support	enabled
Client API library version	5.1.35
Client API header version	5.0.81
MYSQLI_SOCKET	/tmp/mysql.sock

Is this normal? I mean API library version is 5.1 and API header version is 5.0 ?

It seems that everything is running except the domains... I restarted the server without any errors but domains don't show up.

phpMyAdmin returns blank screen....

My fault, everything works except pages that are connected with database. For example a simple php file without any db connection works fine but when I try to connect to a database ti returns blank screen.

Well I revert it again to MySQL 5.0.81 till any help on this :)
 
Last edited:
Try changing your my.cnf config file to include:

socket=/var/run/mysql.sock

under the [mysqld] section.

/tmp seems like a weird directory to have the socket file.
 
well it seems that mysql.sock is located under /tmp directory

Code:
server:/var/run# ls
acpid.pid     avahi-daemon  crond.reboot      directadmin.pid  httpd.pid  network	   proftpd	  rsyslogd.pid	 sshd.pid
acpid.socket  bind	    da-popb4smtp.pid  dovecot	       motd	  portmap_mapping  proftpd.pid	  sm-notify.pid  utmp
atd.pid       crond.pid     dbus	      exim.pid	       mysqld	  portmap.pid	   rpc.statd.pid  sshd
server:/var/run# cd /
server:/# find / | grep mysql.sock
/tmp/mysql.sock
server:/# find / | grep mysqld.sock
server:/#
 
Have you tried this?

Code:
ln -s /var/run/mysqld/mysql.sock /tmp/mysql.sock
 
i upgrade from 5.0.81 to 5.1.37

error
Stopping mysqld: [ OK ]
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 '/tmp/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 '/tmp/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.
server:/usr/local/directadmin/custombuild#
try restart it don't work
 
@panosru thanks to explain your problem, it help me to solve my problem too.
 
Back
Top