web stats OS X Client Server » MYSQL



Archive for the 'MYSQL' Category

Help, Where did all my drive space go?

Saturday, August 11th, 2007

I noticed this week a big problem with my OS X Server. The finder was telling me that I only had 3 gb available. I counted the size of all the folders in my drive and it looked like I only had used about 15 gb so I should have 45 gb of free space. Some how I was losing 45 gb of space I no mater what tools I used I could not find was was stealing my hard drive space. On top of this my drive was filling up fast. Each day I lost more and more of the drive space. Soon this drive would be full.

I tried calling apple and their only suggestion was to format the drive. Since this was my server I dreaded this option. Luckily before I reported the brutality of a reformat I did a little creative googling. I found a few different forum posts that when used together saved my sanity..

The first command which found where the problem files were is:

In the terminal type (this command takes a long time to complete):

sudo /usr/bin/find -x / -size +40000000c -exec /bin/ls -lh “{}” \;

That command will find and list all the large files on your hard drive.

In my case the problem was a bunch of MYSQL Replication bin log files that were over 1 gig each.

To delete the old mysql_binary_log files I ran this command in mysql:

Login to mysql: mysql -u username -p

Then type

PURGE MASTER LOGS BEFORE DATE_SUB( NOW(), INTERVAL 5 DAY);

That command will remove any bin that are older then 5 days.

Running that one line command save me countless hours of work.

I has a similar problem with my relay logs on one of my slave servers.
running the command:
sudo /usr/bin/find -x / -size +40000000c -exec /bin/ls -lh “{}” \;

showed me that my problem was with my relay logs.

Im not sure that this is the right way to fix the relay log problem but it worked in my situation:

type in mysql:

change master to master_host='’”;

This changes the master host and deletes the old logs. This may not be how you want to do this because you might need restart replication.

Lost in transfer: Files going to wrong desktop.

Sunday, April 15th, 2007

Today I was backing up my servers mysql database remotely using:

/usr/local/mysql/bin/mysqldump -u username -ppassword –skip-lock-tables –add-drop-table –all-databases > remotebackup.sql

I was using the Command Shell in Webmin

Webmin
(more…)

Install Webmin server tools on OS X

Sunday, April 15th, 2007

Webmin is the best tool I have ever used for OS X server. Webmin allows you to configure and monitor all of your servers parameters remotely.

Webmin
Here is a list of some of Webmins features:

-Configure almost all Apache directives and features.
-Create and edit domains and DNS records.
-Perform manual or scheduled backups and restores of configuration files managed by Webmin modules.
-View reports on bandwidth usage by host, port, protocol and time on a Linux system
(more…)

Optimize and Repair MYSQL Database on OS X

Sunday, February 11th, 2007

MYSQL comes with a very powerful tool to optimize and repair your database called mysqlcheck.

MYSQL

To have mysqlcheck check and repair all of your databases:

Open a Terminal window (Applications -> Utilities - > Terminal)

OS X Terminal
(more…)

Can’t connect to local MySQL server through socket /tmp/mysql.sock os x- ERROR 2002 (HY000) os x

Monday, December 4th, 2006

MYSQL

The other day suddenly MYSQL on my OS X web server stopped working.
I was getting this error:
ERROR 2002 (HY000) Can’t connect to local MySQL server through socket /tmp/mysql.sock

(more…)