• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Unable to connect to database

L

Le Zhou

Guest
hi everyone here.. I really need some help with my Plesk 8

this morning I was trying to back up the database without shutting down the server.. then I got this


ERROR: PleskFatalException
Unable to connect to database: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

0: /usr/local/psa/admin/plib/common_func.php3:154
psaerror(string 'Unable to connect to database: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)')
1: /usr/local/psa/admin/auto_prepend/auth.php3:87

Please help me to save my database.. and get this fixed.. Thanks a lot!!!!!
 
is mysql running? if so, try restarting the service. if not, start it :)
 
[root@le ~]# mysql --version
mysql Ver 14.12 Distrib 5.0.45, for redhat-linux-gnu (x86_64) using readline 5.0

[root@le ~]# service mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]

So now that I know MySQL is not running. I have tried to start and restart mysql, but no luck.. Would you please teach me how to start mysql, Please!? Thanks!
 
Last edited by a moderator:
[root@le ~]# service mysqld status
mysqld is stopped

[root@le ~]# ps -el |grep mysqld
4 R 0 3207 18134 0 80 0 - 13692 - ? 00:00:00 mysqld
4 S 0 18134 1 3 80 0 - 22082 wait ? 00:00:57 mysqld_safe
 
Last edited by a moderator:
Still

1st of all. Thanks for replying back to me again. I have followed some steps which you provided. then I got some messages back while using ssh.

[root@le ~]# tail /var/log/mysql.log
tail: cannot open `/var/log/mysql.log' for reading: No such file or directory

[root@le ~]# mysql_install_db
mkdir: cannot create directory `/var/lib/mysql/test': No space left on device
chmod: cannot access `/var/lib/mysql/test': No such file or directory
chown: cannot access `/var/lib/mysql/test': No such file or directory
Installing MySQL system tables...
ERROR: 1004 Can't create file '/tmp/#sql7758_1_0.frm' (errno: 28)
090310 23:47:17 [ERROR] Aborting

090310 23:47:17 [Note] /usr/libexec/mysqld: Shutdown complete

Installation of system tables failed!

Examine the logs in /var/lib/mysql for more information.
You can try to start the mysqld daemon with:
/usr/libexec/mysqld --skip-grant &
and use the command line tool
/usr/bin/mysql to connect to the mysql
database and look at the grant tables:

shell> /usr/bin/mysql -u root mysql
mysql> show tables

Try 'mysqld --help' if you have problems with paths. Using --log
gives you a log in /var/lib/mysql that may be helpful.

The latest information about MySQL is available on the web at
http://www.mysql.com
Please consult the MySQL manual section: 'Problems running mysql_install_db',
and the manual section that describes problems on your OS.
Another information source is the MySQL email archive.
Please check all of the above before mailing us!
And if you do mail us, you MUST use the /usr/bin/mysqlbug script!

IS this one looks really bad?!! I have no clues now.. Please Please help me!!!!
 
Yo dawg there's your problem:

mkdir: cannot create directory `/var/lib/mysql/test': No space left on device

do a "df -h" ... are your partitions full?
 
[root@le ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 448G 448G 0 100% /
/dev/sda1 99M 19M 76M 20% /boot
tmpfs 2.0G 0 2.0G 0% /dev/shm

I know the backup files are save in the tmp folder.

[root@le ~]# /usr/libexec/mysqld --skip-grant &
[1] 16343
[root@le ~]# 090312 0:28:32 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
090312 0:28:32 InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 3318873.
InnoDB: Doing recovery: scanned up to log sequence number 0 3318873
090312 0:28:32 InnoDB: Started; log sequence number 0 3318873
090312 0:28:32 [ERROR] /usr/libexec/mysqld: Error writing file '/var/lib/mysql/le.pid' (Errcode: 28)
090312 0:28:32 [ERROR] Can't start server: can't create PID file: No space left on device

if I to fix this I have to finish my database backups. but can I stop it. I don't want to backup anymore. or how can I delete those backup files in the "Tmp" folder? Would you please guide me more. Thanks so so much!!!
 
Last edited by a moderator:
Back
Top