MySQL – Create temporary table

mysql-tutorials

How to create and drop Temporary table in MySQL  In MySQL, a temporary table is a special type of table that allows you to store a temporary result set. A temporary table is very handy when it is impossible or expensive to query data that requires a single SELECT statement with the JOIN clauses. In this case, you can use a temporary table to store the immediate result and use another query to process it. Create Temporary table SynTax CREATE TEMPORARY TABLE <<NEW TABLE>> SELECT * FROM EMPLOYEE Drop Temporary Table…

Read More

MySQL – Change Column type to DATETIME with TimeStamp

mysql-tutorials

How to change existing database table column to AUTO DATE TIME field & Value. Simple command to change the existing column to AUTO TIME STAMP Syntax :- ALTER TABLE `<TABLE NAME>` CHANGE COLUMN `<COLUMN NAME>` `<COLUMN NAME` TIMESTAMP NOT NULL DEFAULT ‘0000-00-00 00:00:00’ Example ALTER TABLE `stockTr` CHANGE COLUMN `createdDate` `createdDate` TIMESTAMP NOT NULL DEFAULT ‘0000-00-00 00:00:00’

Read More

Disable copy paste in HTML without Javascript

html5 sample code

There are simple function available in HTML 5 itself to avoid drag & drop in the textbox or text area and disable paste in the textbox or text area. HTML Tag onDrop to use to stop drag any items into the textbox / textarea HTML Tag onPaste to use to stop paste values into the textbox / textarea. Sample :- <input type=”textare” ondrop=”return false;” onpaste=”return false;”> <textarea rows=”4″ cols=”50″ ondrop=”return false;” onpaste=”return false;”> CheckedResponsive.com Site </textarea>

Read More

How to create user to taking backup only in mySQL ? MySQL

mysql-tutorials

Is there simple command available to give limited access the user to take backup the database in mySQL WorkBench with limited access. Step : 1 CREATE USER ‘username’@’%’ IDENTIFIED BY ‘pa$$w0rd’; Step : 2 GRANT SELECT, SHOW VIEW, LOCK TABLES, RELOAD, REPLICATION CLIENT ON *.* TO ‘userName’@’%’; Step: 3 FLUSH PRIVILEGES; The users not required INSERT or ALTER TABLE privileges to take backup te database. The above set of privileges enough to take the backup from the mysqldump programs. And it will be sufficient to backup database also.  

Read More

myTop – mySQL – Database – Performance Monitoring Tool

mysql-tutorials

myTop is one of free open source code to monitor mySQL Database in CUI mode. The terminal window show the statistics information about threads queries, uptime and more etc.., The tool helps to optimize and improve performance of mySQL to handle large request and response in the database server. How to install myTOP in Ubuntu ? sudo apt install mytop Configuring myTOP sudo nano /root/.mytop Copy and paste the default settings. host=localhost db=mysql delay=3 port=3306 socket= batchmode=0 color=1 idle=0 Connecting to myTOP :- sudo mytop -u <<USERNAME> –prompt Sample myTOP…

Read More

Google hangout emoji shortcut

WordPress permalink

Google hangout – EMOJI Shortcut keys. Simple keys to show and share in EMOJI   :C frowning/sad face 🙂 or 🙂 smiley (U+263A) <3 heart (U+2764) -<@% honeybee :(|) monkey face :(:) pig face (Y) or (y) thumb up (N) or (n) thumb down (]:{ man with turban </3 or <\\3 broken heart ~@~ pile of poo 😀 or 😀 grinning face ^_^ grinning face with closed eyes :”D laughing face with tears =D laughing face open mouth with happy eyes ^_^;; laughing face open mouth with tear O:) or O=) O:-)…

Read More

strpos in php: PHP strpos(), substr(),

Find the first position for the string inside the string :- strpos() echo strpos(“I love apple, I love apple too!”,”apple”);   Return word from the string substr() substr(“Hello world”,6); echo substr(“Hello world”,0,-1)   – Result : Hello worl echo substr(“Hello world”,-10,-2) – Result : ello wor echo substr(“Hello world”,0,-6) – Result : Hello  

Read More