MySQL not working

password

Verified User
Joined
Oct 11, 2011
Messages
127
Hi guys

MySQL stopped working on my server today. I decided to reinstall MySQL with custombuild and tried:

Code:
cd /usr/local/directadmin/custombuild
./build mysql d

I then get the following error:
Code:
Dumping database mysql
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect
Dumping database performance_schema
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect
Dumping database test
mysqldump: Got error: 2002: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) when trying to connect
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 with default connection arguments
/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.

Can someone give me some pointers on how to get MySQL reinstalled? I have manual backups of each database so i don't need to restore anything.

Regards
password
 
Check if this exist:

/usr/local/mysql/bin/mysqlcheck

If not, find it on your system and copy/symlink to request path.

then try again.

Regards
 
No i had access errors with MySQL and that's why i tried to reinstall it.

It showed me:
Error connecting to MySQL: Access denied for user: 'da_admin@localhost' (Using password: YES)

And reseting the root password by following this did not work either:
http://help.directadmin.com/item.php?id=45

I actually had a root password provided in /usr/local/directadmin/scripts/setup.txt, but couldn't login to MySQL with it.

I thought that reinstalling would solve this... perhaps not?
 
have you tryed log as da_admin with password saved in /usr/local/directadmin/conf/mysql.conf ?

Usually the root password saved in setup.txt is the same of da_admin user, if you changed root password and you can still connect to mysql with the new password as root, try reset the da_admin password using the same stored in the file ive linked upper here.

Then directadmin should be able again to log into mysql.

Regards
 
I can't login to MySQL with either root or da_admin using any of the passwords i have tried. I seem to be locked out! =)
 
Well... i don't seem to have it?

Code:
s01:~# whereis mysqld_safe
mysqld_safe:
 
Try:

Code:
find / -name mysqld_safe

Regards

I found it, and tried the following:

Code:
sudo /usr/local/mysql-5.5.16-linux2.6-x86_64/bin/mysqld_safe --skip-grant-tables &

and then i typed:
Code:
use mysql
UPDATE mysql.user SET password=PASSWORD('newpass') WHERE user='root';
FLUSH PRIVILEGES;
quit

All i got was: Command not found

I also tried:

Code:
mysql -u root

and that gave me:

Code:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

Thanks for all your help so far! I'm starting to go nuts about this DA install. Usually everything works like a charm, but this time I get loads of weird errors.
 
I read somewhere that you should define the path to mysql.sock inside this file:
/usr/local/directadmin/conf/mysql.conf

So i added:
socket=/tmp/mysql.sock

at line 1 and saved it = no changes.
 
You might need to run:

/usr/local/directadmin/scripts/mysql.sh

I ran it and got:
Code:
Starting mysqld:                [ OK ]
Waiting for mysqld to start....
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

It also says i need to run:
Code:
./bin/mysql_secure_installation

Where am i suposed to be while executing this command?
 
Back
Top