Click to See Complete Forum and Search --> : Help MySQL running and it won't get down!
Danster
02-02-2001, 09:10 PM
Any ideas?
[root@sloppy init.d]# ./mysqld stop
Stopping MySQL: [FAILED]
[root@sloppy init.d]# ./mysqld status
mysqld (pid 537 536 523) is running...
I need to shut it down so I can upgrade:
:cool: mysql-3.23.32-1.7.i386.rpm
Danster
02-02-2001, 09:32 PM
Yikes NOW IT WON'T START :o
I just did:
# killall mysqld
# rpm -Uvh --force mysql-*
mysql ##################################################
mysql-devel ##################################################
group mysql does not exist - using root
group mysql does not exist - using root
group mysql does not exist - using root
mysql-server ##################################################
# ./mysqld start
chown: mysql.mysql: invalid group
Starting MySQL: [ OK ]
[root@sloppy init.d]# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
Any ideas :confused:
reinerm
02-02-2001, 09:43 PM
# ./mysqld start
chown: mysql.mysql: invalid group
try to see if you have "mysql" group, if you do'nt have maybe you should add.
reiner
The King Ant
02-02-2001, 09:56 PM
Check to make sure mysql is running: "ps auxw | grep -i sql", and maybe "/etc/rc.d/init.d/mysql status"
About that error during the install:
The mysql group and user should have been added when you first installed MySQL. You really should have those...
You could add it manually, like above, or uninstall mysql and then reinstall it. You should backup any important database files and stuff first, even though they shouldn't be removed during the uninstall.
I think everything is in the /var/lib/mysql directory, but you probably want to double check that.
Danster
02-02-2001, 10:08 PM
# /usr/sbin/groupadd mysql
Did get rid of the group problem, but it still won't start. Any other ideas? I forced the install again-- wouldn't that do the same as uninstall, reinstall?
# rpm -Uvh --force mysql-*
mysql ##################################################
mysql-devel ##################################################
mysql-server ##################################################
[root@sloppy init.d]# ./mysqld start
Starting MySQL: [ OK ]
# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) :confused:
Danster
02-02-2001, 10:17 PM
Tried another type of start and that made Linux just hang :(
# /usr/bin/safe_mysqld --user=mysql &
[1] 14054
[root@sloppy init.d]# Starting mysqld daemon with databases from /var/lib/mysql
010203 02:01:57 mysqld ended
Danster
02-02-2001, 11:06 PM
installing from src.rpm's didn't help either. Any ideas?
# rpm -Uvh --nodeps --force MySQL*
MySQL ##################################################
Installing all prepared tables
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
This is done with:
/usr/bin/mysqladmin -u root -p password 'new-password'
/usr/bin/mysqladmin -u root -h sloppy -p password 'new-password'
See the manual for more instructions.
NOTE: If you are upgrading from a MySQL <= 3.22.10 you should run
the /usr/bin/mysql_fix_privilege_tables. Otherwise you will not be
able to use the new GRANT command!
Please report any problems with the /usr/bin/mysqlbug script!
Starting mysqld daemon with databases from /var/lib/mysql
cannot remove /usr/lib/mysql - directory not empty
MySQL-client ##################################################
MySQL-devel ##################################################
MySQL-shared ##################################################
Danster
02-02-2001, 11:28 PM
now I don't know why but it's up but issuing:
# mysql
doesn't work????
# mysql
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
But it looks like it's running:
# ps auxw | grep -i sql
[root@sloppy init.d]# /etc/rc.d/init.d/mysqld start
Starting MySQL: [ OK ]
[root@sloppy init.d]# ps auxw | grep -i sql
root 20473 1.3 0.3 2056 1008 pts/8 S 03:13 0:00 sh /usr/bin/safe_mysqld --defaults-file=/etc/my.cnf
mysql 20490 2.6 0.5 11744 1444 pts/8 S 03:13 0:00 /usr/sbin/mysqld --defaults-file=/etc/my.cnf --basedir=/ --datadir=/v
mysql 20492 0.0 0.5 11744 1444 pts/8 S 03:13 0:00 /usr/sbin/mysqld --defaults-file=/etc/my.cnf --basedir=/ --datadir=/v
mysql 20493 0.0 0.5 11744 1444 pts/8 S 03:13 0:00 /usr/sbin/mysqld --defaults-file=/etc/my.cnf --basedir=/ --datadir=/v
# /etc/rc.d/init.d/mysqld status
mysqld (pid 20493 20492 20490) is running...
Any ideas?? :rolleyes:
The King Ant
02-02-2001, 11:50 PM
Er, um, try "mysql -h 'hostname'"
That is from: http://www.bitmechanic.com/mail-archives/mysql/Jul1999/0166.html
Danster
02-02-2001, 11:56 PM
Maybe I need to manually edit some conf files after the upgrade ???
Thx for the suggestions. I tried:
# mysql -h 'localhost'
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111)
[root@sloppy dmoore]# mysql -h 'sloppy'
ERROR 1130: Host 'localhost.localdomain' is not allowed to connect to this MySQL server
:eek:
Sweede
02-03-2001, 12:46 AM
The best thing about unix/linux is that there are LOG FILES that record EVERYTHING that happens.
i bet you a 1$ that your Log file will tell you whats going on.
your logs are in /var/lib/mysql/hostname.err
check it out, i bet you find what the problem is.
Danster
02-03-2001, 06:31 AM
The problem is:
1. mysql path is shagged -- any ideas? C B-lo
2. the DBs on the server are gone -- I'll re-import them (no biggie)
# /usr/bin/mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 4 to server version: 3.23.32-log
Type 'help;' or '\h' for help. Type '\c' to clear the buffer
mysql> exit
BUT just issuing mySQL seems to point to an old version???
# mysql :eek:
ERROR 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (111) :confused:
Danster
02-03-2001, 09:36 AM
Ok - it's sorted -- sort of...
1. the databases have been recreated, but one wasn't backed up - the advert rotation :rolleyes: is completely lost
2. the path problem was sorted by putting symbolic links to the mysql binary and the sock: ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock
Danster
02-05-2001, 10:44 AM
Ok -- I recovered the old databases. copy the directories from the old locations to the new ones:
Old mysql data location: /usr/local/var/
New mysql data location: /var/lib/mysql/
You will then have to play around with permissions to get your mysql user to recognize the database. mysql has to own the files.
chown mysql <files>
chmod 600 <files> [or] chmod 777 <files>
I also changed the directory permissions though I shouldn't have to ...
Thanks again everybody.
:D