Posts Tagged ‘database’

Completely remove MySQL server including all the data from Debian

I just tried to uninstall MySQL on Debian via apt-get remove –purge mysql-server apt-get remove –purge mysql-client apt-get autoremove and wondered that the directories /var/lib/mysql /etc/mysql still existed after the commands. Then I recognized, that a apt-get remove –purge ‘mysql-server.*’ is doing better and removes everything. Note: if you get a /etc/init.d/mysql: WARNING: /etc/mysql/my.cnf cannot [...]

Neo4j. NoSQL graph database

Neo4j is a graph database, storing data in the nodes and relationships of a graph. The most generic of data structures, a graph elegantly represents any kind of data, preserving the natural structure of the domain.

Picking the right noSQL system

Need some help to pick the right noSQL solution for your project? Then maybe Nathan Hurst’s Visual Guide to noSQL systems is a good starting point. It’s based on the requirements from Brewer’s CAP theorem (Consistency, Availability and Partition Tolerance).  

Save SQL result into file

Often it is useful to export a SQL query result into a file. Especially CSV files are nice for this task. The following SQL query saves the result in a file called output.csv into the /tmp directory: SELECT * FROM my_table INTO OUTFILE ‘/tmp/output.csv’ FIELDS TERMINATED BY ‘,’ ENCLOSED BY ‘”‘ LINES TERMINATED BY ‘\n’;

mybatis

Shame on me, that it took my brain 4 months to recognize that Apache Ibatis has retired and has become mybatis.

uninitialized constant MysqlCompat::MysqlRes

I just had the following problem when trying to start a Ruby on Rails application on a fresh installation of Mac OS X Snow Leopard after I installed the mysql gem via gem install mysql: uninitialized constant MysqlCompat::MysqlRes I searched a bit and found a solution here. It was a problem with a buggy version [...]

Twitter: Using file based message queue instead of SQL database

Just found this in a pretty old article about Twitter and it’s architecture. Now, a more sane way to do this (if I may be so bold) is to keep a message queue for every member, and whenever someone posts a new message, copy a pointer to that message into the queue of every member [...]

Difference between utf8_bin and utf8_general_ci

utf8_bin: compare strings by the binary value of each character in the string utf8_general_ci: compare strings using general language rules and using case-insensitive comparisons utf8_general_cs: compare strings using general language rules and using case-sensitive comparisons via PHPBuilder

Exporting and importing database using utf8 encoding

Export the data mysqldump -p –default_character-set=utf8 -u USERNAME –skip-set-charset database_name > DUMPFILE.sql Create the database you want to import in CREATE DATABASE database_name CHARACTER SET utf8 COLLATE utf8_bin Import the data: mysql -u USERNAME -p –default-character-set=utf8 –max_allowed_packet=64M database_name < DUMPFILE.sql