Archive for June, 2009

How to change the storage engine to InnoDB

1.Edit the /etc/my.cnf file and look for this line:

skip-innodb

and comment it out:

#skip-innodb

2.Add the following entry in the /etc/my.cnf file

default-storage_engine = InnoDB

3. Save the file, and restart mysql

/etc/rc.d/init.d/mysqld restart

4. You can use the following command to check the “storage engine” used in the server.

mysqladmin variables | grep storage_engine

You will see the storage engine as “InnoDB”.

# mysqladmin variables | grep storage_engine
| storage_engine | InnoDB
SBDavid

Reseller list missing in WHM

Reseller list missing in WHM

This article discusses how to resolve issues where the WHM reseller list has disappeared however they still exist in Apache’s configuration and the users’ directories still exist in /home
Resolutions

1)/var/cpanel/users/

/var/cpanel/users/username should have the following syntax per line “DNS=domain.com” line. If not, edit this file and change the line to DNS=domain.com

Secondly, be sure to check that the DNS zone above exists in “Edit DNS Zone” in WHM. If not, add it via “Add DNS Zone” in WHM.

2)/etc/httpd/conf/httpd.conf

Double check that there is a VirtualHost container per domain in /var/named/

3)/etc/userdomains

/etc/userdomains should have the following syntax per line “domain.com: user” where user is the reseller. If not, edit this file and change the file to match.

4)/etc/trueuserdomains

/etc/trueuserdomains should also have the following syntax per line “domain.com:user”where user is the domain owner user. If not:

mv /etc/trueuserowners /etc/trueuserowners1

/scripts/updateuserdomains

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.

Timeout error occurred when trying to start MySQL Daemon.

If you are getting the following error while trying to start MySQL service;

[root@ ~]# /etc/init.d/mysqld restart
Stopping MySQL: [FAILED]
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]

And if you are getting the following error in the MySQL log;

[root@ ~]# tail -f /var/log/mysqld.log
080503 14:30:28 [ERROR] Can’t start server: can’t create PID file: No space left on device
Number of processes running now: 0
080503 14:30:28 mysqld restarted
080503 14:30:28 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.

The issue might be due to the lack of space in the ‘/var’ partition. So you need to reduce the disk space, which should fix the issue.

[root@ ~]# df -h
[root@ ~]# cd /var
[root@ ~]# du -sch *

Using the above commands, you can see that files and folders which consumes more size. You need to delete the unwanted files or folders and try reduce the size.

Try restart the MySQL service.

[root@ ]# /etc/init.d/mysqld restart
Stopping MySQL: [ OK ]
Starting MySQL: [ OK ]

:)

Steps to change the mysql database directory in Linux server

Some times the ‘/var’ partition get crowded and we might need to relocate the database to some other location where there is enough space. Below are the steps given for a trouble free relocation.

Note: Let ‘/mysql’ be the directory to which we want to relocate the database.

Steps to change the mysql database directory:

1. Execute the following command in the server to write the transactions saved in the memory to the hard disk.

mysqladmin -u root -p flush-tables

2. Stop the mysql process in the server.

/etc/rc.d/init.d/mysql stop

3. Move the database files to the the new directory.

mv /var/lib/mysql/* /mysql/

4. Create symlink with the old directory.

ln -s /test/mysql /var/lib/mysql/

5. Give the correct ownership to the new directory.

chown -R mysql:mysql /mysql/*

6. Restart mysql in the server.

/etc/rc.d/init.d/mysql start

« Prev - Next »