Archive for the tag 'mySQL'

SBDavid

SSH tunnel for Mysql

SSH tunnel for Mysql

This will open a tunnel, listening on localhost:3308 and forwarding everything to yourdomain.com:3306

ssh -L 3308:yourdomain.com:3306 username@yourdomain.com

And then

mysql -u username -p -h 127.0.0.1 -P 3308 databasename

Warning message in PhpMyAdmin after upgrading MySQL version to 5 In cPanel server.

In cPanel server after upgrading MySQL version to 5, PhpMyAdmin shows a warning message as given below

Your PHP MySQL library version 4.1.22 differs from your MySQL server version 5.0.45

CPanel’s internal PHP is not compiled with MySQL 5. That is why you are facing this issue. In order to fix this, perform the following steps.

1) Run the script /scripts/makecpphp
2) Copy the PHP binary inside /var/cpanel/3rdparty//bin/ to /usr/local/cpanel/3rdparty/bin/

That will fix the problem.

SBDavid

MySQL Socket Error in phpMyAdmin

MySQL Socket Error in phpMyAdmin

While accessing phpMyAdmin, you may get the following error.

#2002 - The server is not responding (or the local MySQL server’s socket is not correctly configured)

This is due to the missing socket file in the location /tmp.

The socket path which is specified in the phpMyAdmin configuration file is /tmp/mysql.sock.

$ vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php
cfg['Server']['socket'] = ‘/tmp/mysql.sock’;

If mysql.sock is missing in /tmp, then create a link to the mysql.sock file in /var/lib/mysql.

$ ln -s /var/lib/mysql/mysql.sock /tmp/mysql.sock

There is also another fix for this issue.

1. Open the phpMyadmin config file “config.inc.php”.

vi /usr/local/cpanel/base/3rdparty/phpMyAdmin/config.inc.php

2.Locate the line:

$cfg['Servers'][$i]['host'] = ‘localhost’;

3.Replace ‘localhost’ with ‘127.0.0.1′ and save.

$cfg['Servers'][$i]['host'] = ‘127.0.0.1′;

MySQL: got error 28 from server handler

This error means no space left on hard disk. If you get his error, you need to check all filesystems where MySQL operates.

a) Stop mysql server

# /etc/init.d/mysql stop
OR
# /etc/init.d/mysqld stop

b) Check filesystem and /tmp directories:

$ df -h
$ cd /tmp
$ df -h /tmp

c) Remove files from /tmp to free up space:

# cd /tmp
# rm -rf *

d) Look into /var/log directory and remove or compress logs file.

e) Use myisamchk command to check and repair of ISAM table:

# cd /var/lib/mysql
# myisamchk

f) Increase disk space (add new hard disk or remove unwanted softwares)

g) Start the mysql server:

# /etc/init.d/mysql start
OR
# /etc/init.d/mysqld start

MySQL service is failing to start up with error “Can’t init databases”

Following is the error message in mysql server log file /var/log/mysqld.log:

/usr/libexec/mysqld: Can’t create/write to file ‘/tmp/ibCfJwf1? (Errcode: 13)

While trying to start it, following is the error.

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

This error occurs when MySQL is not able to access the /tmp directory to write and create temporary files. Make sure /tmp is owned by root and 1777 permisssion is set on /tmp directory.

Following commands will fix the problem.

# chown root:root /tmp
# chmod 777 /tmp
# /etc/init.d/mysqld start

Now MySQL should start without a problem.

« Prev - Next »