mysql error, failed, endless search for fix

Status
Not open for further replies.
S

Secret Agent

Guest
I spent way too long trying to fix this and search the cpanel forums, tried just about every possible method and nothing worked.

i followed this and reinstalled mysql
http://www.devside.net/web/server/linux/mysql

Restarted in WHM and still get the same error:


/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)' Check that mysqld is running and that the socket: '/tmp/mysql.sock' exists! mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").

Nothing wants to work

root [/]# cd /var/lib/mysql
root [/var/lib/mysql]# chmod 771 *
root [/var/lib/mysql]# chmod 777 mysql.sock
chmod: failed to get attributes of `mysql.sock': No such file or directory
root [/var/lib/mysql]# chmod 660 <hostname>.pid
chmod: failed to get attributes of `server.myactualhostname.pid': No such file or directory

I've tried everything and I can't believe nothing is working

I rebooted the server as well and retried so many methods. I reset MySQL password and no luck. I don't know what else to do honestly.
 
S

Secret Agent

Guest
Yes, does nothing

root@server [~]# yum install mysql-server mysql
Gathering header information file(s) from server(s)
Server: Centos-3 - i386/i686 - Addons
Server: Centos-3 - i386/i686 - Base
Server: Centos-3 - i386/i686 - Extras
Server: Centos-3 - i386/i686 - Updates
Finding updated packages
Downloading needed headers
Cannot find a package matching mysql-server
Cannot find a package matching mysql
No actions to take
 

easyhoster1

Well-Known Member
Sep 25, 2003
656
0
166
We got this error before.

Make sure in your /etc/my.cnf you have this line
[mysqld]
socket=/tmp/mysql.sock << or path to your .sock file

Then restart MSQL;

If it fails when you restart, try again..Sometimes it takes a couple attempts to get it started.
 
S

Secret Agent

Guest
Doesn't work :(

Restarted mysql 3 times in a row via whm and got the same:

/usr/bin/mysqladmin: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)' Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists! mysql has failed, please contact the sysadmin (result was "Warning, no valid mysql.sock file found.mysql has failed").

/etc/my.cnf is:

[mysqld]
port=3306
set-variable = max_connections=500
safe-show-database
socket=/tmp/mysql.sock
Code:
root@server [/tmp]# ls
./                                     sess_78013b7aa072ce24442c85345b825781
../                                    sess_a3b628789127f7d775b1ccfb7a2e9ab3
horde.log                              sess_ca21ca9acca102fec9d1c97c743e86a5
.ICE-unix/                             sess_ef064dde9b2c5196ea8f0b3be6d57921
lost+found/                            .s.PGSQL.5432=
nobody-session-0.281111988079832       .s.PGSQL.5432.lock
sess_6dac0d584196ca6e1802ed3b2cd991af
Code:
root@server [/var/lib/mysql]# ls
./                       ib_logfile0*   mysql/
../                      ib_logfile1*   paljapan_infofresh/
astra_7art/              infofresh/     server-bin.001*
eximstats/               info_fresh/    server-bin.index*
horde/                   leechprotect/  server.info-fresh.com.err*
ib_arch_log_0000000000*  mail/          server.pid*
ibdata1*                 modsec/        test/
This has been so hectic...unreal.
 

dave9000

Well-Known Member
Apr 7, 2003
888
1
168
arkansas
cPanel Access Level
Root Administrator
without logging into the box and checking things this may be difficult

first check the permissions of /var/lib/mysql

make sure its 0755 and mysql:root

chmod 0755 /var/lib/mysql

chown mysql:root /var/lib/mysql

cat /etc/passwd and make sure user mysql exists
 
S

Secret Agent

Guest
I did those two and restarted mysql, same thing..

This is from the server.hostname.pid.err file (last portion of it)

050302 21:42:13 mysqld started
050302 21:42:13 Warning: Asked for 196608 thread stack, but got 126976
050302 21:42:13 InnoDB: Started
050302 21:42:13 /usr/sbin/mysqld: Can't open file: 'host.MYI'. (errno: 142)
050302 21:42:13 Fatal error: Can't open privilege tables: File '/usr/share/mysql/charsets/?.conf' not found (Errcode: 2)
050302 21:42:13 Aborting

050302 21:42:13 InnoDB: Starting shutdown...
050302 21:42:16 InnoDB: Shutdown completed
050302 21:42:16 /usr/sbin/mysqld: Shutdown Complete

050302 21:42:16 mysqld ended

050302 21:42:55 mysqld started
050302 21:42:55 Warning: Asked for 196608 thread stack, but got 126976
050302 21:42:55 InnoDB: Started
050302 21:42:55 /usr/sbin/mysqld: Can't open file: 'host.MYI'. (errno: 142)
050302 21:42:55 Fatal error: Can't open privilege tables: File '/usr/share/mysql/charsets/?.conf' not found (Errcode: 2)
050302 21:42:55 Aborting

050302 21:42:55 InnoDB: Starting shutdown...
050302 21:42:57 InnoDB: Shutdown completed
050302 21:42:57 /usr/sbin/mysqld: Shutdown Complete

050302 21:42:57 mysqld ended
 

dave9000

Well-Known Member
Apr 7, 2003
888
1
168
arkansas
cPanel Access Level
Root Administrator
does /var/lib/mysql/mysql/host.MYI exist ?

and chmod -R 0660 /var/lib/mysql/mysql

and chown -R mysql:mysql /var/lib/mysql/mysql

if /var/lib/mysql/mysql/host.MYI does not exist then set the permissions and run

/usr/bin/mysql_install_db
 
S

Secret Agent

Guest
I ran that too and now this

root@server [/var/lib/mysql]# cd / ; /usr/bin/mysqld_safe &
[1] 6192
root@server [/]# Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/lib/mysql/server.myhostname.com.pid
050302 22:05:12 mysqld ended


[1]+ Done /usr/bin/mysqld_safe



root@server [/var/lib/mysql]# /usr/bin/mysql_install_db
Installing all prepared tables
050302 22:02:21 Warning: Asked for 196608 thread stack, but got 126976
050302 22:02:21 /usr/sbin/mysqld: Shutdown Complete


To start mysqld at boot time you have to copy support-files/mysql.server
to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h server.myhostname.com 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!

You can start the MySQL daemon with:
cd / ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with the benchmarks in the 'sql-bench' directory:
cd sql-bench ; perl run-all-tests

Please report any problems with the /usr/bin/mysqlbug script!

The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at https://order.mysql.com
 
S

Secret Agent

Guest
I also ran /scripts/mysqlup

MySQL Setup Script Version 6.0
Fetching version information from http://updates.cpanel.net/mysqlinstall/version (CURRENT)....Done
This is the MySQL 4.1.10 installer release number 0 for platform
MySQL-shared is out of date (MySQL-shared-4.0.23-0 != MySQL-shared-4.1.10-0)
MySQL-shared-compat is out of date (MySQL-shared-compat-4.0.23-0 != MySQL-shared-compat-4.1.10-0)
MySQL-devel is out of date (MySQL-devel-4.0.23-0 != MySQL-devel-4.1.10-0)
MySQL-embedded is out of date (MySQL-embedded-4.0.23-0 != MySQL-embedded-4.1.10-0)
MySQL-client is out of date (MySQL-client-4.0.23-0 != MySQL-client-4.1.10-0)
MySQL-bench is out of date (MySQL-bench-4.0.23-0 != MySQL-bench-4.1.10-0)
MySQL-server is out of date (MySQL-server-4.0.23-0 != MySQL-server-4.1.10-0)
MySQL-shared is out of date (MySQL-shared-4.0.23-0 != MySQL-shared-4.1.10-0)
Gathering header information file(s) from server(s)
Server: Centos-3 - i386/i686 - Addons
Server: Centos-3 - i386/i686 - Base
Server: Centos-3 - i386/i686 - Extras
Server: Centos-3 - i386/i686 - Updates
Finding updated packages
Downloading needed headers
db4-devel is installed and is the latest version.
pam-devel is installed and is the latest version.
openssl096b is installed and is the latest version.
openssl is installed and is the latest version.
openssl-devel is installed and is the latest version.
gcc is installed and is the latest version.
glibc-devel is installed and is the latest version.
compat-db is installed and is the latest version.
zlib-devel is installed and is the latest version.
rpm-build is installed and is the latest version.
No actions to take
Resetting MySQL to cPanel Defaults and Installing the Latest Version
I ran out of mirrors for MySQL.


Notice...even mirrors are no good...what a crappy day :(
 
S

Secret Agent

Guest
root@server [~]# Starting mysqld daemon with databases from /var/lib/mysql
STOPPING server from pid file /var/lib/mysql/server.hostname.com.pid
050302 22:23:55 mysqld ended
<it hangs here for a long time, I have to hit enter to continue it>
[1]+ Done /usr/bin/mysqld_safe --user=mysql

root@server [~]# service mysql start
root@server [~]#


Restarted mysql again and same error
 
Status
Not open for further replies.