ERROR 1040 (08004): Too many connections


Issue : I got the above error while loading website on the browser.

ERROR 1040 (08004): Too many connections

Solution :

The issue is due to the maximum mysql connections set on the configuration file. You can change it on the my.cnf file like pasted below.

1. Open the file /etc/my.cnf and the following line.

max-connections=500

2.Restart the mysql service.

3. Try to load the website now and increase the value if the issue still persist.

That’s all….!!!!

How to reset WHMCS admin password via database


You can reset the WHMCS admin password through database using the following steps.

If for some reason password reset email does not arrive to your email address, follow the steps below to reset the password via database.

1. Log in your cPanel and navigate to Databases section. Then go to phpMyAdmin.

2. Once inside, find the database in  which you have installed whmcs and look for tbladmins table. Click on Edit next to the admin user in question.

whmcspass3

Note :

If you do not recall the database name of your WHMCS installation, check configuration.php file located in the root folder. Where you can find the database name  like pasted below.

$db_name = ‘tricks_whmcs’

In the above example, tricks_whmcs is the database name.

3.  On the next page look for password column.

In the last field enter the new password and select MD5 hash option. In the passwordhash column you need to remove the value from the last field.

whmcspass4

4. Once done, scroll down to the bottom of the page and click on Go.

 

Changing eaccelerator cache directory


Issue :

We know that the default directory for eaccelerator cache is “/tmp/eaccelerator”. In most of the cases, this directory causing the /tmp to fill and that will cause many issues. In such cases it’s better to change the cache directory to another large partition.

Solution:

Use the following command to find cache director specified in “php.ini”‘ file.

# grep eaccelerator.cache_dir /usr/local/lib/php.ini

i.e;

root@tricks[~]# grep eaccelerator.cache_dir /usr/local/lib/php.ini
eaccelerator.cache_dir=”/tmp/eaccelerator”
root@tricks[~]#

Then change it to another directory “/var/eaccelerator” and save the file.

i.e; eaccelerator.cache_dir=”/var/eaccelerator”

Then create the folder “/var/eaccelerator”

# mkdir /var/eaccelerator

After that use the following commands.

#service httpd stop

#rm -rf /tmp/eaccelerator

#service httpd start

That’s all….!!!!

Eaccelerator filling up /tmp folder


Issue:

I have found that /tmp is full and the issue was due to eaccelerator cache. You can check whether the eaccelerator is filling your tmp folder using “du -sch” command.

solution:

Fist check the size of eaccelerator using the following command.

root@tricks[~]# du -sch /tmp/eaccelerator

261M /tmp/eaccelerator
261M total
root@tricks [~]#

You can clear it using the following command.

tmpwatch –mtime –all 336 /tmp/eaccelerator

Now check the size of eaccelerator using “du -sch” command.

root@tricks[~]# du -sch /tmp/eaccelerator
40K /tmp/eaccelerator
40K total
root@tricks [~]#

That’s all……..!!!

MySQL: Can’t create/write to file ‘/backup/tmp/#sql_3c6_0.MYI’ (Errcode: 2)


Issue: I got this error when accessing the certain pages of drupal website.

MySQL: Can’t create/write to file ‘/backup/tmp/#sql_3c6_0.MYI’ (Errcode: 2)

Solution:

Check the location of tmp directory inside my.cnf and change it to /tmp

1.check mysql config : my.cnf

cat /etc/my.cnf | grep tmpdir

2.If the tmpdir is missing or /tmp is not mentioned there, please add it.

i.e; tmpdir=/tmp to my.cnf under [mysqld]

3.Restart the mysql server

/etc/init.d/mysql restart

That’s all……..!!!!

/usr/sbin/mysqld: Table ‘./cphulkd/logins’ is marked as crashed and should be repaired


Issue : I got the above error from mysql log file and the Innodb on the server is not working.

Solution:

There are several potential reasons why the “cphulkd” database can become corrupted. It’s possible the database was not shut down successfully, or MySQL was killed during a write. The best way to resolve this issue is to simply repair the database.

First check if the cphulkd databse is corrupted using the following command.

#mysqlcheck cphulkd

If the check shows errors, please repair it

# mysqlcheck -r cphulkd

Now try to start mysql on the server with Innodb

That’s all….!!!

Starting MySQL. ERROR! The server quit without updating PID file


Issue: I got this error while restarting mysql service

solution:

You just needs to add the below line in /etc/my.cnf

[mysqld]
innodb_force_recovery = 1

Please restart mysql now.

If this doesn’t help remove the entry and add the below in my.cnf file

[mysqld]
skip-innodb

Restart it now.

That's all......!!!

ERROR 1045 (28000): Access denied for user ‘user’@’localhost’ (using password: YES)


Issue: I got the above error while accessing MySQL as a user

root@afsal []# mysql -u test_tricks -p
Enter password:
ERROR 1045 (28000): Access denied for user  ‘test_tricks’@’localhost’ (using password: YES)
root@afsal []#

Solution:

Give grant all privilege for the user to particular database

grant all privileges on test_wordpress.* to ‘test_tricks@localhost’ identified by ‘password’;

Note:  test_wordpress -> database name

test_tricks           -> mysql user

Password             -> mysql user’s password

 

ERROR 1044 (42000): Access denied for user ‘root’@’localhost’ to database ‘cphulkd’


Issue : I got the above error while accessing any database as root user

Solution :

1. Try after giving grant all privilege to the root user

If it not works please do the following steps.

  1. Stop mysqld and restart it with the --skip-grant-tables option.
  2. Connect to the mysqld server with just: mysql (i.e. no -p option, and username may not be required).
  3. Issue the following commands in the mysql client:

    UPDATE mysql.user SET Grant_priv='Y', Super_priv='Y' WHERE User='root';

    FLUSH PRIVILEGES;

After that, you should be able to run GRANT ALL ON *.* TO 'root'@'localhost';

Now try to access the database. That’s all 🙂

Command to find version of cpanel,Apache,php and MySQL on a server


1.cPanel version

You can find cPanel version using the following command

/usr/local/cpanel/cpanel  -V

2. Apache version

You can find the Apache version using the following command

httpd  -V

3.PHP version

You can find the PHP version using the following command

php  -v

4.MySQL version

You can find the MySQL version using the following command

mysql  -V

Previous Older Entries

Blog Stats

  • 37,399 hits