I posted some time ago about installing Cassandra on Mac OSX. Admittedly I generally use Linux when dealing with Cassandra but have recently been using it on Mac OSX again so here are some tips when working with Cassandra on ac OSX.
I’ve recently posted some more tips on using Cassandra on Mac OSX: Cassandra on Mac
If you don’t already have homebrew then install it from here.
Then it as simple as:
brew install cassandra
This doesn’t install the python driver for the cqlsh command line tool. To do this install it first install python if you haven’t got it already: Continue reading
For people used to relational databases, using NoSQL solutions such as MongoDB brings interesting challenges. One of them is schema design: while in the relational world, normalization is a good way to start, how should we design our collections when creating a new MongoDB application?
Let’s see with a simple example how we would create a data structure for MySQL (or any relational database) and for MongoDB. We will assume in this post that we want to store people information (their name) and the details from their passport (country and validity date). Continue reading
The 2 major types of table storage engines for MySQL databases are InnoDB and MyISAM. To summarize the differences of features and performance,
- InnoDB is newer while MyISAM is older.
- InnoDB is more complex while MyISAM issimpler.
- InnoDB is more strict in data integrity while MyISAM is loose.
- InnoDB implements row-level lock for inserting and updating while MyISAM implements table-level lock. Continue reading
The result of mysqldump is a flat text file containing the sql commands used to restore the mysql databases/tables that were dumped. Normally the result of mysqldump is compressed (in regular backups) because the size of the resulted file is normally big and good compression rates are achieved on such text files. To do this manually using gzip we just run:
gzip -v outputfile.sql
This quick tip shows how you can run the same thing on the fly with only one command directly compressing the resulted file. This might be useful in situations where space is a problem and the full dump can’t be saved on the available storage directly because of its size. Also this might be useful to not run it in 2 commands and have one compact command (maybe used also in some backup scripts, etc.) Continue reading
If you have recently upgraded your MySQL version to 5.6, your mysqldump command will probably throw the following error:
mysqldump: Couldn't execute 'SET OPTION SQL_QUOTE_SHOW_CREATE=1': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'OPTION SQL_QUOTE_SHOW_CREATE=1' at line 1 (1064)
The reason for this is that MySQL 5.6 has removed support for “SET OPTION” and your mysql client tools are probably on older version. Most likely 5.5 or 5.1. There is more info about this issue on MySQL bugs website. Continue reading
In this post, I want to share a piece of useful source code to make a singleton connection in NodeJs. By using this piece of code, you will have always one connection in your NodeJs application, so it will be more faster. Also, if you are using NodeJs frameworks like ExpressJs, it will be useful too.
var Db = require('mongodb').Db; var Connection = require('mongodb').Connection; var Server = require('mongodb').Server; //the MongoDB connection var connectionInstance; Continue reading
As i know, there are two ways to calculate MySQL database size.
1. SQL script
Sum up the data_length + index_length is equal to the total table size.
- data_length – store the real data.
- index_length – store the table index.
Here’s the SQL script to list out the entire databases size Continue reading
– Ubuntu Linux 7.10 Gutsy Gibbon and MySQL 5.0.45. (2007-10-21)
– Ubuntu Linux 6.06 Dapper Drake and MySQL 4.1.15. Continue reading
After continuous running of Mysql server, I’ve noticed that /var/lib/mysql directory uses too much disk space. The reason of that problem was a set of mysqld-bin.xxxxxx files. Each of that file was 1GB in size. First I thought that I can stop the Mysql server and remove that files, but I didn’t want to act this way because there was sensitive data in databases that I didn’t want to loose. So I found the better way to achieve this. Connect to Mysql server and perform the following
mysql> flush logs;
mysql> reset master;
That’s it! After that the all logbin files should be removed. Also you can disable mysqld-bin logging completely by commenting out log-bin line in my.cnf and restarting Mysql server daemon.
Copy from http://linux-howto-guide.blogspot.fr/2009/10/mysqld-bin-logs-problem.html