Technology

mysqldump of particular records without create – drop of tables

Hi,   Recently i was in a situation where i need to take the dump of particular records in mysql. We are pretty much familiar with the normal mysqldump statement given below : [sql] mysqldump --user=usr --password=pwd database_name table_name > dumpFile.sql; [/sql] The above statement will provide us the dump of the...

by Tarun Pareek
Tag: MySql
27-Mar-2012

Grails

Alphanumeric Sorting using Criteria Query (with MySQL database)

I am working on a Grails application with MySQL database. I had a use case in which I had to implement alphanumeric sorting using Criteria Query on Grails. By alphanumeric sorting I mean if there is a class Employee with field empId then on doing : [plain] Employee e1 = new Employee(empId:'emp10').save() Employee e2 = new...

by Gaurav Sharma
Tag: MySql
02-Feb-2012

Grails

Mysql top just like we have top command in Linux

Once in my grails project i was facing the problem of freeze of server.When this happens tomcat becomes unresponsive.Later on by analyzing the thread dump we found that this problem might be due to the database and tomcat communication. So as to analyse how many connection are active at mysql end we found a query. Show processlist; ...

by Anuj Aneja
Tag: MySql
08-Oct-2011

Grails

A use case of Bitwise AND

Recently, I used bitwise Anding in my grails project. I am sharing the approach that we followed by means of an example. Suppose we have a domain class Person which can have multiple attributes like Smart, Intelligent, Talkative etc. What sort of relationship comes to our mind when we see this? I believe the obvious answer would...

by Mohd Farid
Tag: MySql
15-Apr-2011

Grails

Mysql Dump multipurpose script.

Taking MYSQL dump is usual requirement in my project . And Since some of the tables in project are huge so often I have to take dumps of selected tables and often have to ignore some tables. since we had to do it frequently in our project so I created a script  which does following for me. Takes database dump Takes dump of...

by Hitesh Bhatia
Tag: MySql
12-Jan-2011

Technology

MySql : Publish results of a query to a text file

A while back I was trying to debug an error in our application logic. For that I had to analyze the results of a query This analysis was getting pretty tough to do on the command line. So, I tried to find a way to transfer the results of a query to a text file so that they can be analysed easily. With help from google, I got my...

by Himanshu Seth
Tag: MySql
16-Aug-2010

Technology

Changing Location of MySql DataStore

On one of our projects, we had to store the MySql Data at a location different from the default location. This was needed because the server was on an instance-store Amazon instance which meant that the data would get lost if the instance had to be rebooted for some reason. After going through the tutorials and articles on AWS, we came...

by Vivek Krishna
Tag: MySql
07-Jun-2010

Technology

Backup & Restore MySql Database Table(s)

Hi Friends, I needed to take the backup and restore the selected table(s) of mysql database. And I found Gaurav Chauhan's blog on taking dump of the database and to restore the database. So I tried with the same commands but with table names passed as parameters and that worked. mysqldump -u root -p my_database Table1 Table2 >...

by Amit Jain
Tag: MySql
23-Apr-2010