FORUM HOME | WHUK BLOG   
WEB HOSTING UK AFFORDABLE WEBSITE HOSTING SERVICES IN UNITED KINGDOM
PHP LINUX SHARED HOSTING WINDOWS ASP.NET HOSTING PACKAGES
ECOMMERCE HOSTING ASP MSSQL MS ACCESS ODBC FRONTPAGE HOSTING
CPANEL WHM FANTASTICO RESELLER DEDICATED SERVER WEB HOSTING
CHEAP PLESK CPANEL HTML MYSQL BEST UK VPS HOSTING COMPANY
CHEAP RELIABLE UK HOSTING PROVIDER SINCE 2001
MANAGED WEB HOSTING SERVICE
AFFORDABLE WEBSITE HOSTING SERVICES IN UNITED KINGDOM

Web Hosting UK Forums | Linux Windows Dedicated Server and cPanel VPS Hosting Forum » Web Hosting and Domains » FAQ's / Tutorials.

Reply
 
LinkBack Thread Tools Display Modes

  #1 (permalink)  
Old 02-05-11, 02:05 AM
Junior Member
 
Join Date: Dec 2009
Posts: 26
Default Mysql error while connecting to the Plesk panel on Linux server

While login to the Plesk Panel you may get the following error:


Quote:
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: common_func.php3:95 =09psaerror(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: auth.php3:124

Check the mysql service status on the server

Quote:
Quote:
-bash-3.2# /etc/init.d/mysqld status

mysqld dead but subsys locked
You see the mysql service is dead and hence cannot login to Plesk.
Try restarting the mysql service.

Now while restarting the mysql service you may get the following error:

Quote:
-bash-3.2# /etc/init.d/mysqld start
chown: `mysql:mysql': invalid user
chown: `mysql:mysql': invalid user

Checking the mysql logs you get the error logs as below :-

Quote:
-bash-3.2# tail /var/log/mysqld.log

110501 23:38:01 mysqld started
110501 23:38:01 [ERROR] Fatal error: Can't change to run as user 'mysql' ; Please check that the user exists!

110501 23:38:01 [ERROR] Aborting

110501 23:38:01 [Note] /usr/libexec/mysqld: Shutdown complete

As the error suggests the user 'mysql' does not exist.

Add the 'mysql' user

Quote:
-bash-3.2# adduser mysql
Go to mysql directory.

Quote:
-bash-3.2# cd /var/lib/mysql/
Check the ownerships

Quote:
-bash-3.2# ls -la
-bash-3.2# drwx------ 2 27 27 4096 Nov 7 22:28 mysql
You see the ownership isn't right.

Assign the ownership recursively to the mysql user

Quote:
-bash-3.2# chown mysql.mysql -R /var/lib/mysql
Then try to start the mysql service.

Quote:
-bash-3.2# /etc/init.d/mysqld start

Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]

Again the mysql service failed to restart..

Check the mysql logs once again.

Quote:
-bash-3.2# tail /var/log/mysqld.log

110501 23:50:23 mysqld started
110501 23:50:23 InnoDB: Started; log sequence number 1 2821668223
110501 23:50:23 [ERROR] /usr/libexec/mysqld: Can't create/write to file '/var/run/mysqld/mysqld.pid' (Errcode: 13)
110501 23:50:23 [ERROR] Can't start server: can't create PID file: Permission denied
110501 23:50:23 mysqld ended

Now you see there is different error coming up.

Check the ownership of /var/run/mysqld/

Quote:
-bash-3.2# ls -ld /var/run/mysqld/
drwxr-xr-x 2 27 27 4096 May 1 21:49 /var/run/mysqld/
You notice that the ownership isn't right..
Correct the ownership of /var/run/mysqld/

Quote:
-bash-3.2# chown mysql.mysql /var/run/mysqld/

Then try to restart the mysql service..

Quote:
-bash-3.2# /etc/init.d/mysqld start
Starting MySQL: [ OK ]


and it's started just fine !

And now you can successfully login to the Plesk Panel.


Last edited by sven_sim; 02-05-11 at 02:08 AM.
Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT. The time now is 07:31 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Copyright 2001-2010 Web Hosting UK. All rights reserved.
Web Hosting UK Forum





Site Map

Shared Cloud
Shared Cloud From £1

Affiliate Program
Earn up to £300 Per Sale

Dedicated Servers
Dedicated Server Hosting

Cloud Hosting
Cloud Server Hosting

Load Balanced Server
Load Balancing Server

VPS Hosting
Linux VPS Hosting

Windows VPS
Windows 2003 VPS

Zimbra Hosting
Zimbra Email Hosting

cPanel Hosting
Shared Linux Hosting

Windows Hosting
Shared Windows Hosting

Coldfusion Hosting
Windows Coldfusion Hosting

cPanel Reseller Hosting
Reseller Hosting

Windows Reseller
Windows Reseller Hosting

Email Web Hosting
Email Hosting

Semi-Dedicated Server
Semi-Dedicated Hosting

Remote Backup Plans
Offsite Backup Service


cpanel hosting
Knowledgebase Articles

Pre-Sales Question
Web Hosting FAQ's

Dedicated Hosting
Dedicated Server FAQ's

Virtual Private Servers
VPS Hosting

PHP MySQL Hosting
cPanel Hosting

Windows Hosting
ASP MSSQL Hosting

Domain Name
Domain registration FAQ's

CMS Hosting
CMS Hosting FAQ's

Payment Gateways
Payment FAQ's


Support Tutorials

cPanel Tutorials
cPanel Flash Tutorials

Wordpress Tutorials
Wordpress Flash Tutorials

Plesk Tutorials
Plesk Flash Tutorials

PhpMyadmin Tutorials
PhpMyadmin Flash Tutorials

Drupal Tutorials
Drupal Flash Tutorials

Mambo Tutorials
Mambo Flash Tutorials

Joomla Tutorials
Joomla Flash Tutorials

More Hosting Tutorials