This time I am going to explain a very basic CRUD operation on MySql database via NodeJs using Sequelize. Here Sequelize become's a bridge between NodeJs and MySql database, it is a Object Relational Mapping Library written on javascript. Let us quickly learn the things with the help of Examples and we will use Item Table to perform...
Amazon RDS doesn't allow you to change timezone, It keeps same UTC time zone across all regions. time_zone variable in the parameter group is read only.You can change the time zone on each connection or session by making a procedure in default mysql database and call this function on each init connection.1. Create a procedure for...
While working on my current application, I had to import a large database using mysql from a sql dump. The size of the sql dump was around 1.5 GB and hence the import was taking long time. I just felt the need of some tool that could help me check the progress of the import. The command I used was: [sql] mysql --user=username...
While developing a mobile app using phonegap ( or otherwise also :) ), we can access remotely hosted mysql database using jquery ajax calls. But this interaction between jquery and mysql database cannot happen directly. We will need to specify a server side script (in PHP terminology) or a controller action (in Grails Terminology) that...
Very often, we all need to access a remote database for debugging or any other related stuff. The simplest thing that comes to mind is to take the dump of remote database and bring it to the local and run the application using that data. We can avoid that, if we can connect our local mysql client to a remote machine over a SSH...
Recently in my project, we needed to import database dumps of a legacy database in MySQL, which was involved in a nested relationship where one tuple could be the parent record of another tuple. We created the appropriate domain structure and checked that the foreign key references were created accordingly. All well and good. So we...
Recently in one of my project i faced a problem that database was having special character, which is shown as space on the User Interface. So as to solve this issue i found a very simple solution which consists of following steps: 1. First, you just need to identify which type special character to be removed/replaced like in my case...
Hi all, Here is a simple function that can allow you to clear time from the DATETIME field of your database table [sql] DROP FUNCTION IF EXISTS cleartime; delimiter // CREATE FUNCTION cleartime(dt datetime) RETURNS DATETIME NO SQL DETERMINISTIC BEGIN DECLARE t varchar(15); -- the time part of the dt ...
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...
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...
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; ...
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...