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

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