mysql shows fail, yet restarts ok?

S

Secret Agent

Guest
mysql (5.0.22-standard-log)

I start, stop, restart "ok"
chmod 1777 /tmp
service chkservd restart (numerous times)
/scripts/mysqlup --force

Still shows failed in whm.

I followed this but that line does not exist in my.cnf
http://forums.cpanel.net/showthread.php?t=52517

Resetting root password shows this:
Mysql password change failed!!

I reset local as well.

my.cnf
[mysqld]
datadir=/var/lib/mysql
skip-locking
skip-innodb
skip-networking
safe-show-database
query_cache_limit=1M
query_cache_size=128M ## 32MB for every 1GB of RAM
query_cache_type=1
max_user_connections=200
max_connections=500
interactive_timeout=10
wait_timeout=20
connect_timeout=20
thread_cache_size=128
key_buffer=512M ## 128MB for every 1GB of RAM
join_buffer=1M
max_connect_errors=20
max_allowed_packet=16M
table_cache=1024
record_buffer=1M
sort_buffer_size=4M ## 1MB for every 1GB of RAM
read_buffer_size=4M ## 1MB for every 1GB of RAM
read_rnd_buffer_size=4M ## 1MB for every 1GB of RAM
thread_concurrency=8 ## Number of CPUs x 2
myisam_sort_buffer_size=64M
server-id=1
log_slow_queries=/var/log/mysql-slow-queries.log
long_query_time=2
collation-server=latin1_general_ci

[mysql.server]
user=mysql
old-passwords = 1

[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/lib/mysql/mysql.pid
open_files_limit=8192

[mysqldump]
quick
max_allowed_packet=16M

[mysql]
no-auto-rehash
#safe-updates

[isamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[myisamchk]
key_buffer=64M
sort_buffer=64M
read_buffer=16M
write_buffer=16M

[mysqlhotcopy]
interactive-timeout
 

hamper

Well-Known Member
Apr 28, 2006
85
0
156
not sure if this will help, but whenever I run into a problem with mysql like this is first I try the install/update in WHM, when that fails I go to the shell and run everything from the command line.

/scripts/restartsrv_mysql
then
mysqlcheck -Ar
also make sure /tmp isn't full & make sure its chmod to 1777
then I run
/scripts/upcp --force
/scripts/mysqlup --force
-- go into WHM and reset mysql root password
/scripts/easyapache --force
start mysql

for me, it seems I have to rerun just about everything to get it to work again. I also have found that theres a setting in my named.conf that blocks my server from resolving which seems to be the cause of this error for me. so I fix the error each time in named.conf and I no longer have this issue.

HTH
 

hicom

Well-Known Member
May 23, 2003
296
7
168
1) /tmp should be chmod 1777 , not 777

2) clean up your /etc/my.cnf file, make sure it is empty

3) try to restart mySQL from command line (/etc/init.d or /etc/rc.d/init.d or something in that line) This will be able to tell you if any errors occur.

Tamouh
 
S

Secret Agent

Guest
root@server [~]# nano /etc/my.cnf
root@server [~]# /scripts/restartsrv_mysql
Starting MySQL [ OK ]
root@server [~]# service chkservd restart
Stopping chkservd: [ OK ]
Starting chkservd: [ OK ]
root@server [~]# mysqlcheck -Ar
mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect

I emptied my.cnf, restarted mysql, chkservd and still shows failed. I even recompiled apache with system mysql
 
S

Secret Agent

Guest
root@server3 [~]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)



I am lost at this.
 

hamper

Well-Known Member
Apr 28, 2006
85
0
156
reset the master root password for mysql in whm and should fix it. like I said, I always have to reinstall wht I posted to get it running again.
 

chirpy

Well-Known Member
Verifed Vendor
Jun 15, 2002
13,437
33
473
Go on, have a guess
Worked out how to fix this:

service chkservd stop
service mysql stop

pico -w /mysql.recover


#add the following line to /mysql.recover and change MyNewPassword to the password that you want
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('MyNewPassword');

chmod 777 /mysql.recover
mysqld_safe --init-file=/mysql.recover &
service mysql stop
rm -fv /mysql.recover
service mysql start
service chkservd start
 
N

NoAgendas

Guest
Myql failed after upgrading from 4 to 5 via whm, even apache recompile with 'use system mysql'

I tried your method chirpy, didn't work

Restart...

/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Access denied for user 'root'@'localhost' (using password: YES)' mysql has failed, please contact the sysadmin (result was "mysql has failed").

chmod 1777 /tmp
service mysql stop / start (ok)
yet still fails in whm and shows no running mysql processes, shows failed in stats
 
N

NoAgendas

Guest
root@server [~]# top -Umysql
top: Unknown argument `U'
usage: top -hvbcisqS -d delay -p pid -n iterations
 

hicom

Well-Known Member
May 23, 2003
296
7
168
Do:

top -Umysql

and see if mysqld is running, if its running, then mysql working fine, it is just cPanel not able to connect to it (try resetting the password) , also make sure in WHM under Tweak Settings you've enabled old 4.x style passwords.
 

hicom

Well-Known Member
May 23, 2003
296
7
168
hehe..guess ur version different than mine. i'm on BSD.

ok, type:

top

then type letter 'u' which will ask you to enter a username, type: 'mysql' all without the '

---
Also, you can do:

netstat -na | grep 3306
 
N

NoAgendas

Guest
Still failed, no processes running

root@server [~]# netstat -na | grep 3306
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
tcp 0 0 xxx.212.66.66:32936 xxx.39.240.30:3306 ESTABLISHED
tcp 0 0 xxx.212.66.66:3306 207.44.156.17:35602 ESTABLISHED
 

Attachments

N

NoAgendas

Guest
To start fresh I did this:

mv /var/lib/mysql /var/lib/mysql.bak
rpm -e (all rpm's for mysql)

now
/scripts/mysqlup --force

It does nothing, returns blank.
 

meeti

Well-Known Member
Dec 25, 2007
119
0
66
Hi,

i add the

log_slow_queries=/var/log/mysql-slow-queries.log
long_query_time=2
in my /etc/my.cnf,

but i can not get the file mysql-slow-queries.log in /var/log,

should i create the mysql-slow-queries.log file in it manually?


thanks