After I wrote the post: How do I dump all tables in a database into separate files? I got emails from couple people asking how to import the individual table files back in to MySQL. First way to import each sql file created by the post is to import each file individually by [...] …
[Read more]I ran into something with mysql cluster today which boggles my mind. On http://dev.mysql.com/doc/refman/5.0/en/mysql-cluster-config-params-ndbd.html page, it is documented that if we you change datamemory parameter in the config.ini under mysql-cluster like below, you would have to restart nodes to reread the configuration. [NDBD] id=2 HostName=10.0.0.2 # the IP of the first data node DataMemory=6G IndexMemory=512M But when I tried the: [...] …
[Read more]One of my clients asked me today to make their MySQL installation go back to default database install. Basically they wanted me to get rid of all their databases (in this case test databases) so they can start fresh and go live with only the databases they needed. So here are the steps [...] …
[Read more]One of the mysql database servers I manage started to have issues with doing backups yesterday. mysqldump was running but nothing was happening on the backup side. I started to investigate to see why our full backups were failing. I opened up the mysql error log file (mine is at: /usr/local/mysql/var/hostname.err) [...] …
[Read more]I have run in to the issue where I wanted to change some configuration on our production MySQL server but did not want to restart MySQL since its in production. One of the parameters we like to change time to time is the “log_slow_queries” so we can see what queries are slow in production environment. [...] …
[Read more]One very interesting thing I noticed with MySQL was that if you delete a database, ibdata file doesn’t shrink by that much space to minimize disk usage. I deleted the database and checked usage of /usr/local/mysql/var folder and noticed that ibdata file is still the same size. So the problem I face now [...]
In one of my previous posts: MySQL backups, I talked about using a script for automating backups. I show that we can use gzip to compress backup file to compress and save. Since then, our backup file has been growing meg or two a day which is causing our backup files to get [...]
Its that time of the year again when time changes and we have to make sure our servers are using the right zone with right time. Out of many servers I admin, I found 3 servers which had wrong time displaying. All of them had one thing in common, Fedora Core 4. So I fixed it by doing the folowing.
mv /etc/localtime /etc/localtime.old
ln -s /usr/share/zoneinfo/PST8PDT /etc/localtime
I have been asked numerous times what does “load average” means in top. If you don’t know what top is and you have access to linux machine, go type top now and see what it shows.
load average: 2.05, 2.17, 1.93
Quick answer is: first number (2.05) is 1 minute avg, second number (2.17) is 5 minute avg, third number (1.93) is 15 min avg. Generally system admins look at these #’s to see how is their server is doing. But now you wonder, if this is the #’s you look at, why is there cpu %? Isn’t that computer load also? Ofcourse it is. BUT, meaning of cpu % shown in [ Cpu(s): 14.2% us, 1.7% sy, 0.0% ni, 80.7% id, 3.1% wa, 0.0% hi, 0.3% si, 0.0% st ] actually just means how much % of time was spent doing stuff on cpu. On the other hand, load average takes other things such as how much cpu’s were being used and how many process had to wait for their turn to use cpu, etc. Thats why sometimes you will see high % for Cpu …
[Read more]MySQL backups are essential to running a site with MySQL backend. Generally you can get away with doing nightly backups but on our site, due to couple issues we had in past, we are forced to do hourly backups of our db. Intially I was doing backup by using: mysqldump dbname > weekdayHour.dbname.sql hourly. [...]