RSS

Monthly Archives: April 2014

Add custom Code in Mysql Table Column Using Query


if you face problem like that then this code very helpful for you and save your lot of time.

Example: if you want to add Table Unique code after data Enter and you want to inter unique code in sequence with custom code type then use this way.i added image for your help to understand.

After Alter to add new Column with the name of locationCode then you first run this query for number sequence

SET@rank:=0;update T
set Number=@rank:=@rank+1

My Code:

SET @rank:=0;
update location
set LocationCode=@rank:=@rank+1

After Execute this code table column appear Value in Number sequence.if you set custom code type then..


UPDATE Table SET Column= Concat('0', Column);

MyCode: 


update location
set LocationCode=Concat('LOC-', LocationCode)



Add custom Secuance With Query



 

 

 
Leave a comment

Posted by on April 14, 2014 in My SQL

 

Tags: ,

Log_bin_trust_function_creators Mysql


We now have our dump file containing the functions and stored procedures.
I thought I was done at this stage. But I got the following error message while restoring the database on the destination server:

ERROR 1419 (HY000) at line 1140: You do not have the SUPER privilege and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)

 

The error message is pretty clear. Binary logging needs to be enabled in order to restore the functions. There are two ways for doing this:

  • Execute the following command into the MySQL console:
    SET GLOBAL log_bin_trust_function_creators = 1;
  • Add the line log_bin_trust_function_creators = 1 to the mysql.ini configuration file
 
Leave a comment

Posted by on April 1, 2014 in My SQL

 

Tags: