Before we go into how to set up master-slave replication in MySQL, let us talk about some of the reasons I have set up master-slave replication using MySQL. 1) Offload some of the queries from one server to another and spread the load: One of the biggest advantages to have master-slave set [...] …
[Read more]phpsh requires readline support built into python. It also requires python version 2.4+. You can check which version of python you have installed by typing: python -V Let us download and install readline: wget ftp://ftp.cwru.edu/pub/bash/readline-5.2.tar.gz tar zxf readline-5.2.tar.gz cd readline-5.2 ./configure make install Now let us install python with readline support:
wget http://www.python.org/ftp/python/2.5.1/Python-2.5.1.tgz tar zxf Python-2.5.1.tgz cd Python-2.5.1
I had some problems on one of the [...] …
[Read more]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]There have been numerous occasions where I needed to make backups of individual tables from selected database. Usually I can achieve this by typing: mysqldump database_name table1 > table1.sql mysqldump database_name table2 > table2.sql
This could be very painful if you have 10?s or 100?s of tables. Until today, I never ran into a situation where I [...] …
[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]I am reaching out to mysql experts out there! We just inherited a site which uses MySQL master/slave replication. We set up the master and slaves per MySQL documents and did some of our own tweaking in my.cnf to get things working. Things were great when we were testing the site but [...] …
[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 [...]