Posts Tagged ‘mysql’

Oho… MongoDB 2.2 Released

Happy to hear that MongoDB 2.2 has been finally released. Looking forward to use the aggregation framework & co.

(more…)

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 be read.

error when you try to re-install MySQL, try a

apt-get purge mysql-common

and try to re-install again.

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';

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 of  the Mysql driver. So you need to use a different version when installing the mysql gem. So first uninstall the existing gem via

gem uninstall mysql

and reinstall it via

export ARCHFLAGS="-arch i386 -arch x86_64" ;sudo gem install --no-rdoc --no-ri  -v=2.7 mysql -- --with-mysql-dir=/usr/local/mysql  --with-mysql-config=/usr/local/mysql/bin/mysql_config

New Amazon RDS features

Nice replication features in Amazon’s RDS

Management Console – You can now use the web-based AWS Management Console to launch Database Instances (including highly available and reliable Multi-AZ deployments), take real-time snapshots of a DB Instance, and view important database statistics.
Multi-AZ Deployments – With a single API call, you can create a MySQL Database Instance that is synchronously replicated across Availability Zones to provide enhanced data protection and availability in the face of planned or unplanned outages.
Now in all AWS Regions – Amazon RDS is now available in all Amazon Web Services Regions: US East (Northern Virginia), US West (Northern California), EU (Ireland), and Asia Pacific (Singapore).

Exporting and importing database using utf8 encoding

mysqldump is a tool for dumping a database or specific tables. This MySQLdump import example shows in detail how to use this.

(more…)

Jena2 Preview 3

Und es ist wieder ein neues Preview der Jena RDF API veröffentlicht worden – die Nummer 3! In dieser Version wird auch persistentes Speichern unterstützt (vorerst aber nur MySql). Download unter [1] und diskutiert werden kann unter [2].