Move MySQL Directory in WHM \ cPanel

We originally installed an image from the cPanel website. The /root parition holds the system information and the /data  houses the users  web and mail data. Unfortunatley the /root partition is NOT installed as an LVM which makes it difficult to expand. What I did notice is that the users MySQL data is actually stored in the /root Read More…

Trimming MySQL bin logs

During MySQL replication, changes on the Master are written to binary logs for the Slave(s) to update. By default these binary logs will continue to grow indefinitely unless you apply a specific setting. In this scenario I have chosen to keep 4 days worth of bin logs. The amount of bin logs is dependant on how much lag you Read More…

Backup MySQL Database Daily and Keep for 7 days

Here is a script I quickly wrote to mysqldump a single database and keep 7 days worth of backups. #!/bin/bash # Script – mysqlbackup.sh # Created by Jordansphere – 20/Jun/13 DATADIR=”/home/mysqlbackups” USERNAME=username PASSWORD=password NOW=$(date +”%d-%m-%Y”) #BACKUP DATABASE in date format (eg “MyDatabase-20-6-2013.sql”) /usr/bin/mysqldump -u $USERNAME -p$PASSWORD –databases MyDatabase > /home/mysqlbackups/MyDatabase.$NOW.sql # REMOVE BACKUPS MORE THAN Read More…

MySQL : mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication

PHP 5.3 / Mysql 5.5 / FreeBSD   You get the error message: Warning: mysql_connect() [function.mysql-connect]: Premature end of data (mysqlnd_wireprotocol.c:553) in C:\directorya\directoryb\dbconnect.phpon line 57 Warning: mysql_connect() [function.mysql-connect]: OK packet 1 bytes shorter than expected in C:\directorya\directoryb\dbconnect.php on line 57 Warning: mysql_connect() [function.mysql-connect]: mysqlnd cannot connect to MySQL 4.1+ using the old insecure authentication. Please Read More…