<?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 5.7 &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/mysql-5-7/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>Wed, 12 Jul 2017 19:43:17 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.6</generator>
	<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-6ab55cc9135c1723902700/] Step 2: Install latest MySQL Server from updated package [crayon-6ab55cc9135c5508761039/] 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 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="(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 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="(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 5.7: Script to find list of Active InnoDB Temp Tables using INNODB_TEMP_TABLE_INFO</title>
		<link>https://www.dbrnd.com/2016/10/mysql-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info/</link>
					<comments>https://www.dbrnd.com/2016/10/mysql-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 18 Oct 2016 16:16:03 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[find active temp table]]></category>
		<category><![CDATA[INNODB_TEMP_TABLE_INFO]]></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 Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[Temp Table]]></category>
		<category><![CDATA[temporary table]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3800</guid>

					<description><![CDATA[MySQL 5.7 introduced INNODB_TEMP_TABLE_INFO table added into INFORMATION_SCHEMA. Using INNODB_TEMP_TABLE_INFO, you can get A list of all active Temp Table of MySQL InnoDB Instance. You can get the information of all active user created and system created Temp Tables. The Database Administrator can use this script for monitoring total Temp Table in MySQL Server. Unnecessarily, [&#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-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info%2F&amp;linkname=MySQL%205.7%3A%20Script%20to%20find%20list%20of%20Active%20InnoDB%20Temp%20Tables%20using%20INNODB_TEMP_TABLE_INFO" 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-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info%2F&amp;linkname=MySQL%205.7%3A%20Script%20to%20find%20list%20of%20Active%20InnoDB%20Temp%20Tables%20using%20INNODB_TEMP_TABLE_INFO" 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-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info%2F&amp;linkname=MySQL%205.7%3A%20Script%20to%20find%20list%20of%20Active%20InnoDB%20Temp%20Tables%20using%20INNODB_TEMP_TABLE_INFO" 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-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info%2F&amp;linkname=MySQL%205.7%3A%20Script%20to%20find%20list%20of%20Active%20InnoDB%20Temp%20Tables%20using%20INNODB_TEMP_TABLE_INFO" 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-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info%2F&amp;linkname=MySQL%205.7%3A%20Script%20to%20find%20list%20of%20Active%20InnoDB%20Temp%20Tables%20using%20INNODB_TEMP_TABLE_INFO" 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-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info%2F&amp;linkname=MySQL%205.7%3A%20Script%20to%20find%20list%20of%20Active%20InnoDB%20Temp%20Tables%20using%20INNODB_TEMP_TABLE_INFO" 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-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info%2F&#038;title=MySQL%205.7%3A%20Script%20to%20find%20list%20of%20Active%20InnoDB%20Temp%20Tables%20using%20INNODB_TEMP_TABLE_INFO" data-a2a-url="https://www.dbrnd.com/2016/10/mysql-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info/" data-a2a-title="MySQL 5.7: Script to find list of Active InnoDB Temp Tables using INNODB_TEMP_TABLE_INFO"></a></p><p>MySQL 5.7 introduced INNODB_TEMP_TABLE_INFO table added into INFORMATION_SCHEMA. </p>
<blockquote><p>Using INNODB_TEMP_TABLE_INFO, you can get A list of all active Temp Table of MySQL InnoDB Instance.<br />
You can get the information of all active user created and system created Temp Tables.
</p></blockquote>
<blockquote><p>The Database Administrator can use this script for monitoring total Temp Table in MySQL Server.<br />
Unnecessarily, we should not create a TEMP Table because It requires temporary disk + memory storage and degrade the overall performance of MySQL Server. </p></blockquote>
<p>Once you get the list of tables using INNODB_TEMP_TABLE_INFO, you can get system generated Temp Table Name.</p>
<p><strong>Check existance of INNODB_TEMP_TABLE_INFO:</strong></p>
<pre class="crayon-plain-tag">SHOW TABLES FROM INFORMATION_SCHEMA LIKE 'INNODB_TEMP%';</pre> </p>
<p><strong>Create two sample Temporary Table:</strong></p>
<pre class="crayon-plain-tag">CREATE TEMPORARY TABLE ABC (ID INT, Name VARCHAR(50));
CREATE TEMPORARY TABLE XYZ (ID INT, Name VARCHAR(50));</pre> </p>
<p><strong>Get the information of Temp Table:</strong></p>
<pre class="crayon-plain-tag">SELECT * FROM INFORMATION_SCHEMA.INNODB_TEMP_TABLE_INFO

*************************** 1. row ***************************
            TABLE_ID: 93
                NAME: #sqlcec_9_bec
              N_COLS: 5
               SPACE: 76
PER_TABLE_TABLESPACE: FALSE
       IS_COMPRESSED: FALSE
*************************** 2. row ***************************
            TABLE_ID: 92
                NAME: #sqlcec_9_beb
              N_COLS: 5
               SPACE: 76
PER_TABLE_TABLESPACE: FALSE
       IS_COMPRESSED: FALSE
2 rows in set (0.01 sec)</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2016/10/mysql-5-7-script-to-find-list-of-active-innodb-temp-tables-using-innodb_temp_table_info/feed/</wfw:commentRss>
			<slash:comments>3</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL 5.7: How to create an Index on JSON Data Type Column</title>
		<link>https://www.dbrnd.com/2016/10/mysql-5-7-how-to-create-an-index-on-json-data-type-column-generated-virtual-column/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 13 Oct 2016 16:16:24 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[generated column]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSON Data Type]]></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 Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[virtual column]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3729</guid>

					<description><![CDATA[In the previous two articles, I have shared basic detail about MySQL 5.7 JSON Data Type. Our next question is, How we can create an Index on JSON Data Type in MySQL 5.7. As per the official document, actually we cannot directly create an Index on JSON column in MySQL. We have to add generated [&#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-5-7-how-to-create-an-index-on-json-data-type-column-generated-virtual-column%2F&amp;linkname=MySQL%205.7%3A%20How%20to%20create%20an%20Index%20on%20JSON%20Data%20Type%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%2F10%2Fmysql-5-7-how-to-create-an-index-on-json-data-type-column-generated-virtual-column%2F&amp;linkname=MySQL%205.7%3A%20How%20to%20create%20an%20Index%20on%20JSON%20Data%20Type%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%2F10%2Fmysql-5-7-how-to-create-an-index-on-json-data-type-column-generated-virtual-column%2F&amp;linkname=MySQL%205.7%3A%20How%20to%20create%20an%20Index%20on%20JSON%20Data%20Type%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%2F10%2Fmysql-5-7-how-to-create-an-index-on-json-data-type-column-generated-virtual-column%2F&amp;linkname=MySQL%205.7%3A%20How%20to%20create%20an%20Index%20on%20JSON%20Data%20Type%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%2F10%2Fmysql-5-7-how-to-create-an-index-on-json-data-type-column-generated-virtual-column%2F&amp;linkname=MySQL%205.7%3A%20How%20to%20create%20an%20Index%20on%20JSON%20Data%20Type%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%2F10%2Fmysql-5-7-how-to-create-an-index-on-json-data-type-column-generated-virtual-column%2F&amp;linkname=MySQL%205.7%3A%20How%20to%20create%20an%20Index%20on%20JSON%20Data%20Type%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%2F10%2Fmysql-5-7-how-to-create-an-index-on-json-data-type-column-generated-virtual-column%2F&#038;title=MySQL%205.7%3A%20How%20to%20create%20an%20Index%20on%20JSON%20Data%20Type%20Column" data-a2a-url="https://www.dbrnd.com/2016/10/mysql-5-7-how-to-create-an-index-on-json-data-type-column-generated-virtual-column/" data-a2a-title="MySQL 5.7: How to create an Index on JSON Data Type Column"></a></p><p>In the previous two articles, I have shared basic detail about MySQL 5.7 JSON Data Type.<br />
Our next question is, How we can create an Index on JSON Data Type in MySQL 5.7.</p>
<p><a href="https://dev.mysql.com/doc/refman/5.7/en/create-table-secondary-indexes-virtual-columns.html" target="_blank">As per the official document,</a> actually we cannot directly create an Index on JSON column in MySQL.</p>
<blockquote><p>We have to add generated column in Table by extracting require JSON Key data.<br />
Once require JSON key data extracted, we can apply index on that column like any other column. </p></blockquote>
<p>Actually, this is not a good way, but as of now we have only this option to create an indirect Index on JSON Column in MySQL 5.7.</p>
<p><strong>Create sample table using JSON data type:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_TestJSON
(
	ID INTEGER PRIMARY KEY
	,DepartName VARCHAR(250)
	,EmployeeDetails JSON
	,Address JSON
);</pre> </p>
<p><strong>Insert few sample JSON formatted record: </strong></p>
<pre class="crayon-plain-tag">INSERT INTO tbl_TestJSON
VALUES 
(
	1
	,'Sales'
	,'{"firstName": "Anvesh", "lastName": "Patel"}'
	,'
	{"address" : 
		{ 
			"India": "Hyderabad"
			,"USA": "Newyork"
		}
	}'
)
,(
	2
	,'Production'
	,'{"firstName": "Neevan", "lastName": "Patel"}'
	,'
	{"address" : 
		{ 
			"India": "Ahmedabad"
			,"USA": "Washington DC"
		}
	}'
)
,(
	3
	,'Animation'
	,'{"firstName": "Eric", "lastName": "Lorn"}'
	,'
	{"address" : 
		{ 
			"India": "Mumbai"
			,"USA": "Chicago"
		}
	}'
);</pre> </p>
<p><strong>Create aditional generated column for JSON Field EmployeeDetails->firstName:</strong></p>
<pre class="crayon-plain-tag">ALTER TABLE tbl_TestJSON ADD VirtualColumn VARCHAR(50) 
GENERATED ALWAYS AS (JSON_EXTRACT(EmployeeDetails, '$.firstName')) VIRTUAL;</pre> </p>
<p><strong>Create Index on generated column which indirectly work as Index on JSON EmployeeDetails->firstName:</strong></p>
<pre class="crayon-plain-tag">CREATE INDEX idx_tbl_TestJSON_VirtualColumn ON tbl_TestJSON(VirtualColumn);</pre> </p>
<p><strong>Check the execution plan of below query, where you can find usage of newly created Index:</strong></p>
<pre class="crayon-plain-tag">EXPLAIN
SELECT JSON_EXTRACT(EmployeeDetails, "$.firstName") 
FROM tbl_TestJSON 
WHERE VirtualColumn = 'Anvesh';</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL 5.7: Introduced JSON Functions for Search and Manipulation</title>
		<link>https://www.dbrnd.com/2016/10/mysql-5-7-introduced-json-functions-for-search-and-manipulation-json_extract-json_search-json_length-json_array_append/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 12 Oct 2016 16:18:22 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSON_EXTRACT]]></category>
		<category><![CDATA[JSON_KEYS]]></category>
		<category><![CDATA[JSON_LENGTH]]></category>
		<category><![CDATA[JSON_MERGE]]></category>
		<category><![CDATA[JSON_SEARCH]]></category>
		<category><![CDATA[JSON_TYPE]]></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 Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3726</guid>

					<description><![CDATA[In the previous article, I have shared basic about MySQL 5.7 new JSON Data Type. MySQL 5.7 also introduced different types of JSON related function. In this post, I am sharing a few of those important JSON function. First, create a sample table with JSON data type: [crayon-6ab55cc913a56863997833/] Insert few valid JSON Data: [crayon-6ab55cc913a57627714724/] JSON_EXTRACT(): [&#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-5-7-introduced-json-functions-for-search-and-manipulation-json_extract-json_search-json_length-json_array_append%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20JSON%20Functions%20for%20Search%20and%20Manipulation" 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-5-7-introduced-json-functions-for-search-and-manipulation-json_extract-json_search-json_length-json_array_append%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20JSON%20Functions%20for%20Search%20and%20Manipulation" 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-5-7-introduced-json-functions-for-search-and-manipulation-json_extract-json_search-json_length-json_array_append%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20JSON%20Functions%20for%20Search%20and%20Manipulation" 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-5-7-introduced-json-functions-for-search-and-manipulation-json_extract-json_search-json_length-json_array_append%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20JSON%20Functions%20for%20Search%20and%20Manipulation" 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-5-7-introduced-json-functions-for-search-and-manipulation-json_extract-json_search-json_length-json_array_append%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20JSON%20Functions%20for%20Search%20and%20Manipulation" 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-5-7-introduced-json-functions-for-search-and-manipulation-json_extract-json_search-json_length-json_array_append%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20JSON%20Functions%20for%20Search%20and%20Manipulation" 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-5-7-introduced-json-functions-for-search-and-manipulation-json_extract-json_search-json_length-json_array_append%2F&#038;title=MySQL%205.7%3A%20Introduced%20JSON%20Functions%20for%20Search%20and%20Manipulation" data-a2a-url="https://www.dbrnd.com/2016/10/mysql-5-7-introduced-json-functions-for-search-and-manipulation-json_extract-json_search-json_length-json_array_append/" data-a2a-title="MySQL 5.7: Introduced JSON Functions for Search and Manipulation"></a></p><p>In the previous article, I have shared basic about MySQL 5.7 new JSON Data Type.<br />
MySQL 5.7 also introduced different types of JSON related function.<br />
In this post, I am sharing a few of those important JSON function.</p>
<p><strong>First, create a sample table with JSON data type:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_TestJSON
(
	ID INTEGER PRIMARY KEY
	,DepartName VARCHAR(250)
	,EmployeeDetails JSON
	,Address JSON
);</pre> </p>
<p><strong>Insert few valid JSON Data: </strong></p>
<pre class="crayon-plain-tag">INSERT INTO tbl_TestJSON
VALUES 
(
	1
	,'Sales'
	,'{"firstName": "Anvesh", "lastName": "Patel"}'
	,'
	{"address" : 
		{ 
			"India": "Hyderabad"
			,"USA": "Newyork"
		}
	}'
)
,(
	2
	,'Production'
	,'{"firstName": "Neevan", "lastName": "Patel"}'
	,'
	{"address" : 
		{ 
			"India": "Ahmedabad"
			,"USA": "Washington DC"
		}
	}'
)
,(
	3
	,'Animation'
	,'{"firstName": "Eric", "lastName": "Lorn"}'
	,'
	{"address" : 
		{ 
			"India": "Mumbai"
			,"USA": "Chicago"
		}
	}'
);</pre> </p>
<p><strong>JSON_EXTRACT(): To extract or search value in JSON.</strong></p>
<pre class="crayon-plain-tag">SELECT JSON_EXTRACT(Address, "$.address.*") FROM tbl_TestJSON;
+--------------------------------------+
| JSON_EXTRACT(Address, "$.address.*") |
+--------------------------------------+
| ["Newyork", "Hyderabad"]             |
| ["Washington DC", "Ahmedabad"]       |
| ["Chicago", "Mumbai"]                |
+--------------------------------------+

SELECT JSON_EXTRACT(Address, "$.address.India") FROM tbl_TestJSON;
+------------------------------------------+
| JSON_EXTRACT(Address, "$.address.India") |
+------------------------------------------+
| "Hyderabad"                              |
| "Ahmedabad"                              |
| "Mumbai"                                 |
+------------------------------------------+

 SELECT JSON_EXTRACT(Address, "$**.USA") FROM tbl_TestJSON;
+----------------------------------+
| JSON_EXTRACT(Address, "$**.USA") |
+----------------------------------+
| ["Newyork"]                      |
| ["Washington DC"]                |
| ["Chicago"]                      |
+----------------------------------+</pre> </p>
<p><strong>JSON_SEARCH(): Use to search key value path.</strong><br />
one: The search terminates after the first match and returns one path string<br />
all: The search returns all matching path strings such that no duplicate paths are included.</p>
<pre class="crayon-plain-tag">SELECT JSON_SEARCH(Address,'one','Mumbai') FROM tbl_TestJSON; 
SELECT JSON_SEARCH(Address,'all','Mumbai') FROM tbl_TestJSON;</pre> </p>
<p><strong>JSON_LENGTH():Use to check length of JSON document.</strong></p>
<pre class="crayon-plain-tag">SELECT JSON_LENGTH (EmployeeDetails) FROM tbl_TestJSON;</pre> </p>
<p><strong>JSON_TYPE(): Use to check type of JSON document.</strong></p>
<pre class="crayon-plain-tag">SELECT JSON_TYPE (EmployeeDetails) FROM tbl_TestJSON;</pre> </p>
<p><strong>JSON_KEYS(): Use to fetch list of JSON keys.</strong></p>
<pre class="crayon-plain-tag">SELECT JSON_KEYS (EmployeeDetails) FROM tbl_TestJSON;</pre> </p>
<p><strong>JSON_MERGE(): Use to merge JSON data.</strong></p>
<pre class="crayon-plain-tag">SELECT JSON_MERGE('["Anvesh", 1]', '{"Name": "Anvesh"}');
+---------------------------------------------------+
| JSON_MERGE('["Anvesh", 1]', '{"Name": "Anvesh"}') |
+---------------------------------------------------+
| ["Anvesh", 1, {"Name": "Anvesh"}]                 |
+---------------------------------------------------+</pre> </p>
<p><strong>JSON_ARRAY_APPEND(): Use to append any data into JSON document.</strong></p>
<pre class="crayon-plain-tag">SELECT JSON_ARRAY_APPEND('["a", ["b", "c"], "d"]','$[1]','e');
+--------------------------------------------------------+
| JSON_ARRAY_APPEND('["a", ["b", "c"], "d"]','$[1]','e') |
+--------------------------------------------------------+
| ["a", ["b", "c", "e"], "d"]                            |
+--------------------------------------------------------+

SELECT JSON_ARRAY_APPEND('["a", ["b", "c"], "d"]','$[0]','g');
+--------------------------------------------------------+
| JSON_ARRAY_APPEND('["a", ["b", "c"], "d"]','$[0]','g') |
+--------------------------------------------------------+
| [["a", "g"], ["b", "c"], "d"]                          |
+--------------------------------------------------------+</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL 5.7: Introduced Awesome JSON Data Type</title>
		<link>https://www.dbrnd.com/2016/10/mysql-5-7-introduced-awesome-json-data-type-nosql-advantage-in-rdbms-system/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 11 Oct 2016 16:16:19 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[dbrnd]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[JSON Data Type]]></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 Tunning]]></category>
		<category><![CDATA[MySQL Query]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[NoSQL]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=3724</guid>

					<description><![CDATA[This is one of the interesting topics, in the new version of MySQL 5.7 we can store JSON formatted data. Now a day JSON data type is a common feature for all new coming RDBMS product versions like: PostgreSQL 9.4 and SQL Server 2016 have already introduced this. Now We can say, we have MySQL [&#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-5-7-introduced-awesome-json-data-type-nosql-advantage-in-rdbms-system%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20Awesome%20JSON%20Data%20Type" 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-5-7-introduced-awesome-json-data-type-nosql-advantage-in-rdbms-system%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20Awesome%20JSON%20Data%20Type" 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-5-7-introduced-awesome-json-data-type-nosql-advantage-in-rdbms-system%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20Awesome%20JSON%20Data%20Type" 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-5-7-introduced-awesome-json-data-type-nosql-advantage-in-rdbms-system%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20Awesome%20JSON%20Data%20Type" 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-5-7-introduced-awesome-json-data-type-nosql-advantage-in-rdbms-system%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20Awesome%20JSON%20Data%20Type" 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-5-7-introduced-awesome-json-data-type-nosql-advantage-in-rdbms-system%2F&amp;linkname=MySQL%205.7%3A%20Introduced%20Awesome%20JSON%20Data%20Type" 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-5-7-introduced-awesome-json-data-type-nosql-advantage-in-rdbms-system%2F&#038;title=MySQL%205.7%3A%20Introduced%20Awesome%20JSON%20Data%20Type" data-a2a-url="https://www.dbrnd.com/2016/10/mysql-5-7-introduced-awesome-json-data-type-nosql-advantage-in-rdbms-system/" data-a2a-title="MySQL 5.7: Introduced Awesome JSON Data Type"></a></p><p>This is one of the interesting topics, in the new version of MySQL 5.7 we can store JSON formatted data.<br />
Now a day JSON data type is a common feature for all new coming RDBMS product versions like: PostgreSQL 9.4 and SQL Server 2016 have already introduced this. </p>
<blockquote><p>Now We can say, we have MySQL 5.7 with the RDBMS + NOSQL concepts.</p></blockquote>
<blockquote><p>We can store JSON data as strings, but the JSON Data types have the advantage of enforcing that each stored value is valid according to the JSON rules.</p></blockquote>
<blockquote><p>The size of JSON documents stored in JSON columns is limited to the value of the max_allowed_packet system variable.</p></blockquote>
<blockquote><p>The JSON columns cannot have a default value.</p></blockquote>
<p>MySQL 5.7 also introduced a different function to manipulate and manage JSON data in MySQL.<br />
Tomorrow, I will demonstrate these functions. </p>
<p><strong>Small demonstration JSON Data Type:</strong><br />
<strong>Create table with JSON Data type:</strong></p>
<pre class="crayon-plain-tag">CREATE TABLE tbl_TestJSON
(
	ID INTEGER PRIMARY KEY
	,DepartName VARCHAR(250)
	,EmployeeDetails JSON
	,Address JSON
);</pre> </p>
<p><strong>Insert few sample record:</strong></p>
<pre class="crayon-plain-tag">INSERT INTO tbl_TestJSON
VALUES 
(
	1
	,'Sales'
	,'{"firstName": "Anvesh", "lastName": "Patel"}'
	,'{"address" : "Hyderabad"}'
)
,(
	2
	,'Production'
	,'{"firstName": "Neevan", "lastName": "Patel"}'
	,'{"address" : "Ahmedabad"}'
)
,(
	3
	,'Animation'
	,'{"firstName": "Eric", "lastName": "Lorn"}'
	,'{"address" : "USA"}'
);</pre> </p>
<p><strong>You can search key value in WHERE clause:</strong></p>
<pre class="crayon-plain-tag">SELECT *FROM tbl_TestJSON 
WHERE EmployeeDetails-&gt;"$.firstName"="Neevan";</pre> </p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
