<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>MySQL DBA Script &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/category/mysql-dba-script/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.dbrnd.com</link>
	<description>BIGData &#124; NoSQL &#124; MSSQL &#124; MySQL &#124; PostgreSQL</description>
	<lastBuildDate>Fri, 07 Sep 2018 11:41:23 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.4</generator>
	<item>
		<title>MySQL: Script to check the size of Database and Tables</title>
		<link>https://www.dbrnd.com/2018/09/mysql-script-to-check-the-size-of-database-and-tables/</link>
					<comments>https://www.dbrnd.com/2018/09/mysql-script-to-check-the-size-of-database-and-tables/#respond</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 17 Sep 2018 16:16:03 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tuning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7684</guid>

					<description><![CDATA[In this post, I am sharing a script for checking the size of Database and Tables in MySQL. MySQL: Script to find total occupied Size of each Storage Engines MySQL: Script to find Largest Databases size on Server Find the size of Database: [crayon-6a8f9ac6a4ccd494700332/] Find the size of Table: [crayon-6a8f9ac6a4cd0395595581/]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F09%2Fmysql-script-to-check-the-size-of-database-and-tables%2F&amp;linkname=MySQL%3A%20Script%20to%20check%20the%20size%20of%20Database%20and%20Tables" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F09%2Fmysql-script-to-check-the-size-of-database-and-tables%2F&amp;linkname=MySQL%3A%20Script%20to%20check%20the%20size%20of%20Database%20and%20Tables" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F09%2Fmysql-script-to-check-the-size-of-database-and-tables%2F&amp;linkname=MySQL%3A%20Script%20to%20check%20the%20size%20of%20Database%20and%20Tables" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F09%2Fmysql-script-to-check-the-size-of-database-and-tables%2F&amp;linkname=MySQL%3A%20Script%20to%20check%20the%20size%20of%20Database%20and%20Tables" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F09%2Fmysql-script-to-check-the-size-of-database-and-tables%2F&amp;linkname=MySQL%3A%20Script%20to%20check%20the%20size%20of%20Database%20and%20Tables" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F09%2Fmysql-script-to-check-the-size-of-database-and-tables%2F&amp;linkname=MySQL%3A%20Script%20to%20check%20the%20size%20of%20Database%20and%20Tables" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F09%2Fmysql-script-to-check-the-size-of-database-and-tables%2F&#038;title=MySQL%3A%20Script%20to%20check%20the%20size%20of%20Database%20and%20Tables" data-a2a-url="https://www.dbrnd.com/2018/09/mysql-script-to-check-the-size-of-database-and-tables/" data-a2a-title="MySQL: Script to check the size of Database and Tables"></a></p><p>In this post, I am sharing a script for checking the size of Database and Tables in MySQL. </p>
<blockquote class="wp-embedded-content" data-secret="rWPp2uBhf8"><p><a href="https://www.dbrnd.com/2016/10/mysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation/">MySQL: Script to find total occupied Size of each Storage Engines</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/10/mysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation/embed/#?secret=rWPp2uBhf8" data-secret="rWPp2uBhf8" width="600" height="338" title="&#8220;MySQL: Script to find total occupied Size of each Storage Engines&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote class="wp-embedded-content" data-secret="YFZGMKLI1u"><p><a href="https://www.dbrnd.com/2016/10/mysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size/">MySQL: Script to find Largest Databases size on Server</a></p></blockquote>
<p><iframe class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/10/mysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size/embed/#?secret=YFZGMKLI1u" data-secret="YFZGMKLI1u" width="600" height="338" title="&#8220;MySQL: Script to find Largest Databases size on Server&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>Find the size of Database:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	table_schema AS Database_Name
	,ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) AS SizeInMB
FROM information_schema.tables
GROUP BY table_schema</pre> </p>
<p><strong>Find the size of Table:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	table_name AS TableName
	,ROUND(((data_length + index_length) / 1024 / 1024), 2) AS SizeInMB
FROM information_schema.TABLES
WHERE table_schema = 'Database_NAME'
AND table_name = 'Table_Name'</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2018/09/mysql-script-to-check-the-size-of-database-and-tables/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL: Script to find all the Tables without having a Primary Key</title>
		<link>https://www.dbrnd.com/2018/07/mysql-script-to-find-all-the-tables-without-having-a-primary-key/</link>
					<comments>https://www.dbrnd.com/2018/07/mysql-script-to-find-all-the-tables-without-having-a-primary-key/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 30 Jul 2018 16:16:19 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tuning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[Primary key]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7680</guid>

					<description><![CDATA[In this post, I am sharing a script to find all the tables without having a Primary Key in MySQL. This script is very important because Primary Key is a one of a major part of the table. I never recommended like creating a table without Primary Key. Using below script, and find the tables [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F07%2Fmysql-script-to-find-all-the-tables-without-having-a-primary-key%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20all%20the%20Tables%20without%20having%20a%20Primary%20Key" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F07%2Fmysql-script-to-find-all-the-tables-without-having-a-primary-key%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20all%20the%20Tables%20without%20having%20a%20Primary%20Key" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F07%2Fmysql-script-to-find-all-the-tables-without-having-a-primary-key%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20all%20the%20Tables%20without%20having%20a%20Primary%20Key" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F07%2Fmysql-script-to-find-all-the-tables-without-having-a-primary-key%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20all%20the%20Tables%20without%20having%20a%20Primary%20Key" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F07%2Fmysql-script-to-find-all-the-tables-without-having-a-primary-key%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20all%20the%20Tables%20without%20having%20a%20Primary%20Key" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F07%2Fmysql-script-to-find-all-the-tables-without-having-a-primary-key%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20all%20the%20Tables%20without%20having%20a%20Primary%20Key" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F07%2Fmysql-script-to-find-all-the-tables-without-having-a-primary-key%2F&#038;title=MySQL%3A%20Script%20to%20find%20all%20the%20Tables%20without%20having%20a%20Primary%20Key" data-a2a-url="https://www.dbrnd.com/2018/07/mysql-script-to-find-all-the-tables-without-having-a-primary-key/" data-a2a-title="MySQL: Script to find all the Tables without having a Primary Key"></a></p><p>In this post, I am sharing a script to find all the tables without having a Primary Key in MySQL.</p>
<p>This script is very important because Primary Key is a one of a major part of the table. I never recommended like creating a table without Primary Key.</p>
<p><strong>Using below script, and find the tables that do not have a primary key:</strong></p>
<pre class="crayon-plain-tag">select 
	table_schema
	,table_name
from information_schema.columns
where table_schema = 'SCHEMA_NAME'
group by 
	table_schema
	,table_name
having sum(if (column_key in ('PRI', 'UNI'), 1, 0)) = 0</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2018/07/mysql-script-to-find-all-the-tables-without-having-a-primary-key/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL: How to Install MySQL 5.7 on Ubuntu 16.04?</title>
		<link>https://www.dbrnd.com/2017/07/mysql-how-to-install-mysql-5-7-on-ubuntu-16-04/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 23 Jul 2017 16:16:52 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[Install]]></category>
		<category><![CDATA[MySQL 5.7]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tuning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[Ubuntu 16.04]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5678</guid>

					<description><![CDATA[<div><img width="679" height="382" src="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQL-679x382.jpg" class="attachment-post-image size-post-image wp-post-image" alt="MySQL" decoding="async" fetchpriority="high" srcset="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQL-679x382.jpg 679w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQL-1030x579.jpg 1030w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQL-850x478.jpg 850w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQL.jpg 1280w" sizes="(max-width: 679px) 100vw, 679px" /></div>In this post, I am sharing primary steps to install MySQL 5.7 on Ubuntu 16.04. Please follow the below steps, and get ready with MySQL 5.7 in few minutes. Step 1: Update the server package [crayon-6a8f9ac6a500e313352778/] Step 2: Install latest MySQL Server from updated package [crayon-6a8f9ac6a500f378613424/] Step 3: Ask for Root user password, so enter [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="679" height="382" src="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQL-679x382.jpg" class="attachment-post-image size-post-image wp-post-image" alt="MySQL" decoding="async" loading="lazy" srcset="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQL-679x382.jpg 679w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQL-1030x579.jpg 1030w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQL-850x478.jpg 850w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQL.jpg 1280w" sizes="auto, (max-width: 679px) 100vw, 679px" /></div><p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-install-mysql-5-7-on-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20How%20to%20Install%20MySQL%205.7%20on%20Ubuntu%2016.04%3F" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-install-mysql-5-7-on-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20How%20to%20Install%20MySQL%205.7%20on%20Ubuntu%2016.04%3F" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-install-mysql-5-7-on-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20How%20to%20Install%20MySQL%205.7%20on%20Ubuntu%2016.04%3F" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-install-mysql-5-7-on-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20How%20to%20Install%20MySQL%205.7%20on%20Ubuntu%2016.04%3F" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-install-mysql-5-7-on-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20How%20to%20Install%20MySQL%205.7%20on%20Ubuntu%2016.04%3F" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-install-mysql-5-7-on-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20How%20to%20Install%20MySQL%205.7%20on%20Ubuntu%2016.04%3F" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-how-to-install-mysql-5-7-on-ubuntu-16-04%2F&#038;title=MySQL%3A%20How%20to%20Install%20MySQL%205.7%20on%20Ubuntu%2016.04%3F" data-a2a-url="https://www.dbrnd.com/2017/07/mysql-how-to-install-mysql-5-7-on-ubuntu-16-04/" data-a2a-title="MySQL: How to Install MySQL 5.7 on Ubuntu 16.04?"></a></p><p>In this post, I am sharing primary steps to install MySQL 5.7 on Ubuntu 16.04.<br />
Please follow the below steps, and get ready with MySQL 5.7 in few minutes.</p>
<p><strong>Step 1: Update the server package</strong></p><pre class="crayon-plain-tag">sudo apt-get update</pre><p>
<strong>Step 2: Install latest MySQL Server from updated package</strong></p><pre class="crayon-plain-tag">sudo apt-get install mysql-server</pre><p>
<strong>Step 3: Ask for Root user password, so enter your Root password and press OK</strong></p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-5682" src="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLLinuxPassword.png" alt="MySQL Linux Password" width="1201" height="307" srcset="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLLinuxPassword.png 1201w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLLinuxPassword-1030x263.png 1030w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLLinuxPassword-850x217.png 850w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLLinuxPassword-679x174.png 679w" sizes="auto, (max-width: 1201px) 100vw, 1201px" /></p>
<p><strong>Step 4: Make sure about default MySQL Security Options</strong></p><pre class="crayon-plain-tag">sudo mysql_secure_installation</pre><p>
<strong>For testing, I passed below options:</strong></p>
<p><img loading="lazy" decoding="async" class="alignnone size-full wp-image-5683" src="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLLinuxSecurity.png" alt="MySQL Linux Security" width="863" height="824" srcset="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLLinuxSecurity.png 863w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLLinuxSecurity-850x812.png 850w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLLinuxSecurity-679x648.png 679w" sizes="auto, (max-width: 863px) 100vw, 863px" /></p>
<p><strong>Step 5: Check the MySQL Service Status</strong></p><pre class="crayon-plain-tag">systemctl status mysql.service</pre><p>
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5684" src="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLServiceStatus.png" alt="MySQL Service Status" width="866" height="205" srcset="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLServiceStatus.png 866w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLServiceStatus-850x201.png 850w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLServiceStatus-679x161.png 679w" sizes="auto, (max-width: 866px) 100vw, 866px" /></p>
<p><strong>Step 6: Connect MySQL using root user</strong></p><pre class="crayon-plain-tag">mysql -u root -p</pre><p>
<img loading="lazy" decoding="async" class="alignnone size-full wp-image-5685" src="https://www.dbrnd.com/wp-content/uploads/2017/07/ConnectMySQLRoot.png" alt="Connect MySQL Root" width="792" height="306" srcset="https://www.dbrnd.com/wp-content/uploads/2017/07/ConnectMySQLRoot.png 792w, https://www.dbrnd.com/wp-content/uploads/2017/07/ConnectMySQLRoot-679x262.png 679w" sizes="auto, (max-width: 792px) 100vw, 792px" /></p>
<p><strong>Step 7: Final &#8211; Check the version details</strong><br />
<pre class="crayon-plain-tag">mysql&gt; select version();
+-------------------------+
| version()               |
+-------------------------+
| 5.7.18-0ubuntu0.16.04.1 |
+-------------------------+</pre>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL: Script to find Missing Indexes for particular type of Columns</title>
		<link>https://www.dbrnd.com/2017/07/mysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage/</link>
					<comments>https://www.dbrnd.com/2017/07/mysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 04 Jul 2017 16:16:51 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[information_schema.tables]]></category>
		<category><![CDATA[missing index]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tuning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5518</guid>

					<description><![CDATA[In this post, I am sharing a script to find missing indexes in MySQL only for those columns which name ended with &#8216;_id&#8217;. The full table scanning is always creating a performance issue for any database. As a Database Professional, you might be adding database indexes on a table but periodically the volume of data [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Missing%20Indexes%20for%20particular%20type%20of%20Columns" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Missing%20Indexes%20for%20particular%20type%20of%20Columns" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Missing%20Indexes%20for%20particular%20type%20of%20Columns" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Missing%20Indexes%20for%20particular%20type%20of%20Columns" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Missing%20Indexes%20for%20particular%20type%20of%20Columns" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Missing%20Indexes%20for%20particular%20type%20of%20Columns" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F07%2Fmysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage%2F&#038;title=MySQL%3A%20Script%20to%20find%20Missing%20Indexes%20for%20particular%20type%20of%20Columns" data-a2a-url="https://www.dbrnd.com/2017/07/mysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage/" data-a2a-title="MySQL: Script to find Missing Indexes for particular type of Columns"></a></p><p>In this post, I am sharing a script to find missing indexes in MySQL only for those columns which name ended with &#8216;_id&#8217;.</p>
<blockquote><p>The full table scanning is always creating a performance issue for any database.</p>
<blockquote><p>As a Database Professional, you might be adding database indexes on a table but periodically the volume of data is changing so we need to analyze the old indexes, or we should find missing indexes which may require for query optimizer. </p></blockquote>
<p>On the other hand, Database Administrator may also require a report on missing indexes which they can share with developers and users so that they can modify it.</p>
<pre class="crayon-plain-tag">SELECT 
	t.TABLE_SCHEMA
	,t.TABLE_NAME
	,c.COLUMN_NAME
	,IFNULL(kcu.CONSTRAINT_NAME, 'Not indexed') AS Indexed
FROM information_schema.TABLES as t
INNER JOIN information_schema.COLUMNS as c
	ON c.TABLE_SCHEMA = t.TABLE_SCHEMA
		AND c.TABLE_NAME = t.TABLE_NAME
		AND c.COLUMN_NAME LIKE '%_id'
LEFT JOIN information_schema.KEY_COLUMN_USAGE as kcu
	ON kcu.TABLE_SCHEMA = t.TABLE_SCHEMA
		AND kcu.TABLE_NAME = t.TABLE_NAME
		AND kcu.COLUMN_NAME = c.COLUMN_NAME
		AND kcu.ORDINAL_POSITION = 1
WHERE kcu.TABLE_SCHEMA IS NULL
AND t.TABLE_SCHEMA NOT IN ('information_schema', 'performance_schema', 'mysql');</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/07/mysql-script-to-find-a-missing-indexes-of-the-database-key_column_usage/feed/</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL: Script to find Long Running Queries and Transactions</title>
		<link>https://www.dbrnd.com/2017/01/mysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema/</link>
					<comments>https://www.dbrnd.com/2017/01/mysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 25 Jan 2017 23:16:31 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[information_schema.innodb_trx]]></category>
		<category><![CDATA[INFORMATION_SCHEMA.PROCESSLIST]]></category>
		<category><![CDATA[long running query]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[performance schema]]></category>
		<category><![CDATA[performance_schema.events_statements_history]]></category>
		<category><![CDATA[processlist]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3736</guid>

					<description><![CDATA[Don&#8217;t you think so that finding Long Running Queries are a very common requirement for a Database Administrator? &#8216; Yes, Database Administrators are always looking for a list of Long Running Queries. In this post, I am sharing scripts to find Long Running Queries or Transactions of MySQL Database Server. MySQL DBA can use this [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fmysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Long%20Running%20Queries%20and%20Transactions" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fmysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Long%20Running%20Queries%20and%20Transactions" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fmysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Long%20Running%20Queries%20and%20Transactions" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fmysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Long%20Running%20Queries%20and%20Transactions" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fmysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Long%20Running%20Queries%20and%20Transactions" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fmysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Long%20Running%20Queries%20and%20Transactions" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2017%2F01%2Fmysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema%2F&#038;title=MySQL%3A%20Script%20to%20find%20Long%20Running%20Queries%20and%20Transactions" data-a2a-url="https://www.dbrnd.com/2017/01/mysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema/" data-a2a-title="MySQL: Script to find Long Running Queries and Transactions"></a></p><p>Don&#8217;t you think so that finding Long Running Queries are a very common requirement for a Database Administrator? &#8216;</p>
<blockquote><p>Yes, Database Administrators are always looking for a list of Long Running Queries. </p></blockquote>
<blockquote><p>In this post, I am sharing scripts to find Long Running Queries or Transactions of MySQL Database Server. </p></blockquote>
<blockquote><p>MySQL DBA can use this script to take necessary steps against the bad and long running queries which increase the overall performance of MySQL Database Server.</p></blockquote>
<p>In below script, I set 59 seconds internal to find long running query since last 59 seconds.<br />
As per your requirement, you can change this value. </p>
<p>Here, You can also visit few related articles.</p>
<blockquote data-secret="AeA5F0w02e" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2015/11/mysql-how-to-log-general-and-long-running-queries-into-log-table/">MySQL: How to Log General and Long Running Queries into Log Table</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/11/mysql-how-to-log-general-and-long-running-queries-into-log-table/embed/#?secret=AeA5F0w02e" data-secret="AeA5F0w02e" width="600" height="338" title="&#8220;MySQL: How to Log General and Long Running Queries into Log Table&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote data-secret="I52mPLNNBx" class="wp-embedded-content"><p><a href="https://www.dbrnd.com/2016/07/mysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries/">MySQL: Using SQL Query Profiler finds total execution time and CPU information of the Queries</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2016/07/mysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries/embed/#?secret=I52mPLNNBx" data-secret="I52mPLNNBx" width="600" height="338" title="&#8220;MySQL: Using SQL Query Profiler finds total execution time and CPU information of the Queries&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<p><strong>Script without using Performance_schema:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	trx.trx_id
	,trx.trx_started
	,trx.trx_mysql_thread_id
FROM INFORMATION_SCHEMA.INNODB_TRX AS trx
INNER JOIN INFORMATION_SCHEMA.PROCESSLIST AS pl 
	ON trx.trx_mysql_thread_id = pl.id
WHERE trx.trx_started &lt; CURRENT_TIMESTAMP - INTERVAL 59 SECOND
  AND pl.user &lt;&gt; 'system_user';</pre> </p>
<p><strong>Script using Performance_schema:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	pl.id 'PROCESS ID'
	,trx.trx_started
	,esh.event_name 'EVENT NAME'
	,esh.sql_text 'SQL'
FROM information_schema.innodb_trx AS trx
INNER JOIN information_schema.processlist pl 
	ON trx.trx_mysql_thread_id = pl.id
INNER JOIN performance_schema.threads th 
	ON th.processlist_id = trx.trx_mysql_thread_id
INNER JOIN performance_schema.events_statements_history esh 
	ON esh.thread_id = th.thread_id
WHERE trx.trx_started &lt; CURRENT_TIME - INTERVAL 59 SECOND
  AND pl.user &lt;&gt; 'system_user'
ORDER BY esh.EVENT_ID;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/01/mysql-script-to-find-long-running-queries-and-transactions-information_schema-innodb_trx-processlist-performance_schema/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL: Script to find Largest Databases size on Server</title>
		<link>https://www.dbrnd.com/2016/10/mysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 17 Oct 2016 17:16:57 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[database size]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[information_schema.tables]]></category>
		<category><![CDATA[large database size]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3810</guid>

					<description><![CDATA[In this post, I am sharing a useful DBA script to find largest databases on MySQL Server. This kind of handy script always useful while DBA requires quick monitoring on the Database Server. So, I am always finding this kind of script and sharing here for making DBA task easier. I prepared few calculated columns [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Largest%20Databases%20size%20on%20Server" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Largest%20Databases%20size%20on%20Server" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Largest%20Databases%20size%20on%20Server" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Largest%20Databases%20size%20on%20Server" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Largest%20Databases%20size%20on%20Server" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20Largest%20Databases%20size%20on%20Server" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size%2F&#038;title=MySQL%3A%20Script%20to%20find%20Largest%20Databases%20size%20on%20Server" data-a2a-url="https://www.dbrnd.com/2016/10/mysql-script-to-find-biggest-database-size-on-server-information_tables-index-size-table-size-row-size/" data-a2a-title="MySQL: Script to find Largest Databases size on Server"></a></p><p>In this post, I am sharing a useful DBA script to find largest databases on MySQL Server. </p>
<p>This kind of handy script always useful while DBA requires quick monitoring on the Database Server.<br />
So, I am always finding this kind of script and sharing here for making DBA task easier. </p>
<p>I prepared few calculated columns with the help of information_schema.TABLES.</p>
<pre class="crayon-plain-tag">SELECT
	COUNT(*) AS TotalTableCount
	,table_schema
	,CONCAT(ROUND(SUM(table_rows)/1000000,2),'M') AS TotalRowCount
	,CONCAT(ROUND(SUM(data_length)/(1024*1024*1024),2),'G') AS TotalTableSize
	,CONCAT(ROUND(SUM(index_length)/(1024*1024*1024),2),'G') AS TotalTableIndex
	,CONCAT(ROUND(SUM(data_length+index_length)/(1024*1024*1024),2),'G') TotalSize	
FROM information_schema.TABLES
GROUP BY table_schema
ORDER BY SUM(data_length+index_length) 
DESC LIMIT 10;</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL: Script to find total occupied Size of each Storage Engines</title>
		<link>https://www.dbrnd.com/2016/10/mysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation/</link>
					<comments>https://www.dbrnd.com/2016/10/mysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 16 Oct 2016 17:56:03 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[MyISAM]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[Size of Storage Engine]]></category>
		<category><![CDATA[Storage Engines]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3814</guid>

					<description><![CDATA[In this post, I am sharing a script to find the total occupied size of each Storage Engine of MySQL Server. MySQL Provides different types of storage engines like: MyISAM, InnoDB, Memory. I have seen few questions on MySQL Forum like how to migrate MyISAM tables into InnoDB engines and what would be the storage [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20total%20occupied%20Size%20of%20each%20Storage%20Engines" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20total%20occupied%20Size%20of%20each%20Storage%20Engines" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20total%20occupied%20Size%20of%20each%20Storage%20Engines" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20total%20occupied%20Size%20of%20each%20Storage%20Engines" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20total%20occupied%20Size%20of%20each%20Storage%20Engines" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20total%20occupied%20Size%20of%20each%20Storage%20Engines" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F10%2Fmysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation%2F&#038;title=MySQL%3A%20Script%20to%20find%20total%20occupied%20Size%20of%20each%20Storage%20Engines" data-a2a-url="https://www.dbrnd.com/2016/10/mysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation/" data-a2a-title="MySQL: Script to find total occupied Size of each Storage Engines"></a></p><p>In this post, I am sharing a script to find the total occupied size of each Storage Engine of MySQL Server. </p>
<blockquote><p>MySQL Provides different types of storage engines like: MyISAM, InnoDB, Memory.<br />
I have seen few questions on MySQL Forum like how to migrate MyISAM tables into InnoDB engines and what would be the storage size difference. </p></blockquote>
<p>Periodically, Database Administrators have to check the occupied size of each different MySQL Storage Engine which helps them to take decisions on internal migration or for any other reason. </p>
<pre class="crayon-plain-tag">SELECT
	COUNT(*) AS TotalTableCount
	,table_schema
	,CONCAT(ROUND(SUM(table_rows)/1000000,2),'M') AS TotalRowCount
	,CONCAT(ROUND(SUM(data_length)/(1024*1024*1024),2),'G') AS TotalTableSize
	,CONCAT(ROUND(SUM(index_length)/(1024*1024*1024),2),'G') AS TotalTableIndex
	,CONCAT(ROUND(SUM(data_length+index_length)/(1024*1024*1024),2),'G') TotalSize	
FROM information_schema.TABLES
GROUP BY ENGINE
ORDER BY SUM(data_length+index_length) 
DESC LIMIT 10;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/10/mysql-script-to-find-total-occupied-size-of-each-storage-engines-myisam-innodb-size-storage-calculation/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL: Using SQL Query Profiler finds total execution time and CPU information of the Queries</title>
		<link>https://www.dbrnd.com/2016/07/mysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries/</link>
					<comments>https://www.dbrnd.com/2016/07/mysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 30 Jul 2016 19:59:04 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[profiling]]></category>
		<category><![CDATA[SHOW PROFILES]]></category>
		<category><![CDATA[SQL Profiler]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=2153</guid>

					<description><![CDATA[Microsoft SQL Server Profiler is one of the important tool which is useful to find different events and statues of the running queries on Microsoft SQL Server. Do we have anything like SQL Profiler in MySQL? I have found this question on many forums and many of MySQL professionals are curious about SQL Profiler in [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries%2F&amp;linkname=MySQL%3A%20Using%20SQL%20Query%20Profiler%20finds%20total%20execution%20time%20and%20CPU%20information%20of%20the%20Queries" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries%2F&amp;linkname=MySQL%3A%20Using%20SQL%20Query%20Profiler%20finds%20total%20execution%20time%20and%20CPU%20information%20of%20the%20Queries" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries%2F&amp;linkname=MySQL%3A%20Using%20SQL%20Query%20Profiler%20finds%20total%20execution%20time%20and%20CPU%20information%20of%20the%20Queries" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries%2F&amp;linkname=MySQL%3A%20Using%20SQL%20Query%20Profiler%20finds%20total%20execution%20time%20and%20CPU%20information%20of%20the%20Queries" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries%2F&amp;linkname=MySQL%3A%20Using%20SQL%20Query%20Profiler%20finds%20total%20execution%20time%20and%20CPU%20information%20of%20the%20Queries" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries%2F&amp;linkname=MySQL%3A%20Using%20SQL%20Query%20Profiler%20finds%20total%20execution%20time%20and%20CPU%20information%20of%20the%20Queries" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F07%2Fmysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries%2F&#038;title=MySQL%3A%20Using%20SQL%20Query%20Profiler%20finds%20total%20execution%20time%20and%20CPU%20information%20of%20the%20Queries" data-a2a-url="https://www.dbrnd.com/2016/07/mysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries/" data-a2a-title="MySQL: Using SQL Query Profiler finds total execution time and CPU information of the Queries"></a></p><p><em>Microsoft SQL Server Profiler is one of the important tool which is useful to find different events and statues of the running queries on Microsoft SQL Server.</em></p>
<blockquote><p><strong>Do we have anything like SQL Profiler in MySQL?</strong></p>
<p>I have found this question on many forums and many of MySQL professionals are curious about SQL Profiler in MySQL.</p></blockquote>
<blockquote><p>MySQL has SQL Profiler which is built into the database server and you can enable/disable via the MySQL client utility.</p></blockquote>
<blockquote><p>Before executing any queries you can enable SQL Profiler and it is only for your particular session.<br />
Internally, it creates one profiling table into INFORMATION_SCHEMA database and when you disconnect with MySQL client, it destroys this table.</p></blockquote>
<p><strong>Enable SQL Profile at session level:</strong></p><pre class="crayon-plain-tag">SET profiling=1;</pre><p>
<strong>Execute sample query:</strong></p><pre class="crayon-plain-tag">SELECT *FROM table_one;
SELECT *FROM table_two;</pre><p>
<strong>Check the execution time for each query:</strong></p><pre class="crayon-plain-tag">SHOW PROFILES;

/*Result*/
Query_ID   Duration    Query
--------------------------------------------------
1          0.00355325  SELECT *FROM table_one
2          0.00051850  SELECT *FROM table_two</pre><p>
<strong>Check the execution time for second query only:</strong></p><pre class="crayon-plain-tag">SHOW PROFILE FOR QUERY 2;</pre><p>
<strong>Check the CPU information for second query only:</strong></p><pre class="crayon-plain-tag">SHOW PROFILE CPU FOR QUERY 2;</pre><p>
<strong>The Result:</strong></p>
<p><a href="https://www.dbrnd.com/wp-content/uploads/2016/03/MySQLCPUSQLProfiler.png" rel="attachment wp-att-2160"><img loading="lazy" decoding="async" class="alignnone wp-image-2160 size-full" title="MySQL CPU SQL Profiler" src="https://www.dbrnd.com/wp-content/uploads/2016/03/MySQLCPUSQLProfiler.png" alt="MySQL CPU SQL Profiler" width="316" height="350" srcset="https://www.dbrnd.com/wp-content/uploads/2016/03/MySQLCPUSQLProfiler.png 316w, https://www.dbrnd.com/wp-content/uploads/2016/03/MySQLCPUSQLProfiler-271x300.png 271w, https://www.dbrnd.com/wp-content/uploads/2016/03/MySQLCPUSQLProfiler-150x166.png 150w" sizes="auto, (max-width: 316px) 100vw, 316px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/07/mysql-using-sql-query-profiler-finds-total-execution-time-and-cpu-information-of-the-queries/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL: Script to find default Character Set for Database, Table and Column</title>
		<link>https://www.dbrnd.com/2016/04/mysql-script-to-find-default-character-set-for-database-table-and-column/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sun, 24 Apr 2016 20:08:28 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[character set]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1743</guid>

					<description><![CDATA[In this post, I am sharing few scripts for finding the default character set of a MySQL Database, Table and Column. Generally, during the process of database migration, we are checking default character set and collation at MySQL Server level. But in our production MySQL Server, I found that some of the tables have different [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F04%2Fmysql-script-to-find-default-character-set-for-database-table-and-column%2F&#038;title=MySQL%3A%20Script%20to%20find%20default%20Character%20Set%20for%20Database%2C%20Table%20and%20Column" data-a2a-url="https://www.dbrnd.com/2016/04/mysql-script-to-find-default-character-set-for-database-table-and-column/" data-a2a-title="MySQL: Script to find default Character Set for Database, Table and Column"></a></p><p>In this post, I am sharing few scripts for finding the default character set of a MySQL Database, Table and Column.</p>
<p>Generally, during the process of database migration, we are checking default character set and collation at MySQL Server level.</p>
<p>But in our production MySQL Server, I found that some of the tables have different character set which was not required. </p>
<p>As a database professional, we have to maintain consistency between all database objects. </p>
<p><strong>Find default Characater Set for Database:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	default_character_set_name 
FROM information_schema.SCHEMATA 
WHERE schema_name = 'Database_Name';</pre> </p>
<p><strong>Find default Characater Set for Table:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	CCSA.character_set_name 
FROM information_schema.TABLES AS T
INNER JOIN information_schema.COLLATION_CHARACTER_SET_APPLICABILITY AS CCSA
	ON CCSA.collation_name = T.table_collation
WHERE T.table_schema = 'Database_Name'
  AND T.table_name = 'Table_Name';</pre> </p>
<p><strong>Find default Character Set for Column:</strong></p>
<pre class="crayon-plain-tag">SELECT 
	character_set_name 
FROM information_schema.COLUMNS 
WHERE table_schema = 'Database_Name'
  AND table_name = 'Table_Name'
  AND column_name = 'Column_Name';</pre> </p>
<p><strong><code>Please Visit Other Related Articles !</code></strong></p>
<p><a href="https://www.dbrnd.com/2015/10/database-theory-what-is-character-set-and-collation/" target="_blank"></p>
<p><strong>Database Theory: What is Character Set and Collation</strong></a><br />
<a href="https://www.dbrnd.com/2015/10/mysql-how-to-change-default-character-set-to-utf-8/" target="_blank"></p>
<p><strong>MySQL: How to change default Character set to UTF-8</strong></a><br />
<a href="https://www.dbrnd.com/2016/02/mysql-perform-case-sensitive-string-comparison/" target="_blank"></p>
<p><strong>MySQL: Perform Case Sensitive string comparison</strong></a></p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL: Script to find last Updated time of the Table</title>
		<link>https://www.dbrnd.com/2016/02/mysql-script-to-find-last-updated-time-of-the-table/</link>
					<comments>https://www.dbrnd.com/2016/02/mysql-script-to-find-last-updated-time-of-the-table/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 26 Feb 2016 19:29:45 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[MySQL DBA Script]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[information_schema.tables]]></category>
		<category><![CDATA[MySQL Command]]></category>
		<category><![CDATA[MySQL Database Administrator]]></category>
		<category><![CDATA[MySQL Database Designing]]></category>
		<category><![CDATA[MySQL Database Programming]]></category>
		<category><![CDATA[MySQL Error]]></category>
		<category><![CDATA[MySQL Performance Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=1732</guid>

					<description><![CDATA[In this post, I am sharing a DBA query to find the last updated time of the MySQL Table. We can also check the row level last updated time by adding one extra column into a table like last_updated_datetime. For reporting purposes, we are using this approach to check the row level last updated DateTime. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fmysql-script-to-find-last-updated-time-of-the-table%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20last%20Updated%20time%20of%20the%20Table" title="Facebook" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_twitter" href="https://www.addtoany.com/add_to/twitter?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fmysql-script-to-find-last-updated-time-of-the-table%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20last%20Updated%20time%20of%20the%20Table" title="Twitter" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_linkedin" href="https://www.addtoany.com/add_to/linkedin?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fmysql-script-to-find-last-updated-time-of-the-table%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20last%20Updated%20time%20of%20the%20Table" title="LinkedIn" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pinterest" href="https://www.addtoany.com/add_to/pinterest?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fmysql-script-to-find-last-updated-time-of-the-table%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20last%20Updated%20time%20of%20the%20Table" title="Pinterest" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_reddit" href="https://www.addtoany.com/add_to/reddit?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fmysql-script-to-find-last-updated-time-of-the-table%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20last%20Updated%20time%20of%20the%20Table" title="Reddit" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_pocket" href="https://www.addtoany.com/add_to/pocket?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fmysql-script-to-find-last-updated-time-of-the-table%2F&amp;linkname=MySQL%3A%20Script%20to%20find%20last%20Updated%20time%20of%20the%20Table" title="Pocket" rel="nofollow noopener" target="_blank"></a><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fwww.dbrnd.com%2F2016%2F02%2Fmysql-script-to-find-last-updated-time-of-the-table%2F&#038;title=MySQL%3A%20Script%20to%20find%20last%20Updated%20time%20of%20the%20Table" data-a2a-url="https://www.dbrnd.com/2016/02/mysql-script-to-find-last-updated-time-of-the-table/" data-a2a-title="MySQL: Script to find last Updated time of the Table"></a></p><p>In this post, I am sharing a DBA query to find the last updated time of the MySQL Table. </p>
<p>We can also check the row level last updated time by adding one extra column into a table like last_updated_datetime.<br />
For reporting purposes, we are using this approach to check the row level last updated DateTime. </p>
<blockquote><p>As a Database Administrator, we are also responsible for monitoring some of the important tables of our MySQL database.
</p></blockquote>
<p><strong>We can use information_schema.tables to find the information of the MySQL tables. </strong></p>
<p><strong> Using information_schema.tables:</strong></p><pre class="crayon-plain-tag">SELECT UPDATE_TIME
FROM information_schema.tables
WHERE TABLE_SCHEMA = 'Database_Name'
   AND TABLE_NAME = 'Table_Name';</pre><p> </p>
<p><strong>Using Status Command:</strong></p>
<pre class="crayon-plain-tag">SHOW TABLE STATUS FROM Database_Name LIKE 'Table_Name';</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/02/mysql-script-to-find-last-updated-time-of-the-table/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
	</channel>
</rss>
