<?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 Database Administrator &#8211; Database Research &amp; Development</title>
	<atom:link href="https://www.dbrnd.com/tag/mysql-database-administrator/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>Mon, 21 Jan 2019 07:21:38 +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: Download Link for Sample Database (Sakila)</title>
		<link>https://www.dbrnd.com/2019/04/mysql-download-link-for-sample-database-sakila/</link>
					<comments>https://www.dbrnd.com/2019/04/mysql-download-link-for-sample-database-sakila/#respond</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 01 Apr 2019 16:16:20 +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[DVD Rental Database]]></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 Sample Database]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[PostgreSQL Sample Database]]></category>
		<category><![CDATA[Sakila Sample Database]]></category>
		<category><![CDATA[Sample Database]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7021</guid>

					<description><![CDATA[Beginners are always searching for sample database so, in this post, I am sharing an official download link to a MySQL Sakila sample database which we can use for our testing purpose. Sakila sample database is a DVD rental database. The database contains sample tables, views, SPs, Functions and Triggers. The MySQL beginner can install [&#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%2F2019%2F04%2Fmysql-download-link-for-sample-database-sakila%2F&amp;linkname=MySQL%3A%20Download%20Link%20for%20Sample%20Database%20%28Sakila%29" 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%2F2019%2F04%2Fmysql-download-link-for-sample-database-sakila%2F&amp;linkname=MySQL%3A%20Download%20Link%20for%20Sample%20Database%20%28Sakila%29" 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%2F2019%2F04%2Fmysql-download-link-for-sample-database-sakila%2F&amp;linkname=MySQL%3A%20Download%20Link%20for%20Sample%20Database%20%28Sakila%29" 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%2F2019%2F04%2Fmysql-download-link-for-sample-database-sakila%2F&amp;linkname=MySQL%3A%20Download%20Link%20for%20Sample%20Database%20%28Sakila%29" 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%2F2019%2F04%2Fmysql-download-link-for-sample-database-sakila%2F&amp;linkname=MySQL%3A%20Download%20Link%20for%20Sample%20Database%20%28Sakila%29" 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%2F2019%2F04%2Fmysql-download-link-for-sample-database-sakila%2F&amp;linkname=MySQL%3A%20Download%20Link%20for%20Sample%20Database%20%28Sakila%29" 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%2F2019%2F04%2Fmysql-download-link-for-sample-database-sakila%2F&#038;title=MySQL%3A%20Download%20Link%20for%20Sample%20Database%20%28Sakila%29" data-a2a-url="https://www.dbrnd.com/2019/04/mysql-download-link-for-sample-database-sakila/" data-a2a-title="MySQL: Download Link for Sample Database (Sakila)"></a></p><p>Beginners are always searching for sample database so, in this post, I am sharing an official download link to a MySQL Sakila sample database which we can use for our testing purpose. </p>
<p>Sakila sample database is a DVD rental database. The database contains sample tables, views, SPs, Functions and Triggers. </p>
<p>The MySQL beginner can install this database and can start the practice with it.<br />
PostgreSQL beginner can also use this database. </p>
<p>Please check the official page <a href="https://dev.mysql.com/doc/sakila/en/" rel="noopener" target="_blank">here</a>, and you can see all require documentation like, database structure, installation steps.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2019/04/mysql-download-link-for-sample-database-sakila/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<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-6ab3d4127bd6a879095653/] Find the size of Table: [crayon-6ab3d4127bd6c716959628/]]]></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: How to Swap Table or Rename the table in one transaction?</title>
		<link>https://www.dbrnd.com/2018/08/mysql-how-to-swap-table-or-rename-the-table-in-one-transaction/</link>
					<comments>https://www.dbrnd.com/2018/08/mysql-how-to-swap-table-or-rename-the-table-in-one-transaction/#respond</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 06 Aug 2018 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[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[Rename Table]]></category>
		<category><![CDATA[swap table]]></category>
		<category><![CDATA[swap table in a transaction]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7696</guid>

					<description><![CDATA[In this post, I am sharing a command to swap the table in a MySQL Database. Recently, I got a requirement like a swap or rename the table, it should execute in a lock/transaction. People can access the table before or after the swapping only. In an ETL/Database work, we are creating a staging table [&#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%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&amp;linkname=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%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%2F2018%2F08%2Fmysql-how-to-swap-table-or-rename-the-table-in-one-transaction%2F&#038;title=MySQL%3A%20How%20to%20Swap%20Table%20or%20Rename%20the%20table%20in%20one%20transaction%3F" data-a2a-url="https://www.dbrnd.com/2018/08/mysql-how-to-swap-table-or-rename-the-table-in-one-transaction/" data-a2a-title="MySQL: How to Swap Table or Rename the table in one transaction?"></a></p><p>In this post, I am sharing a command to swap the table in a MySQL Database. </p>
<p>Recently, I got a requirement like a swap or rename the table, it should execute in a lock/transaction. People can access the table before or after the swapping only. </p>
<p>In an ETL/Database work, we are creating a staging table for validation and later it requires to overwrite with an original table name. </p>
<p><strong>Below is a simple command, which you can use for this task:</strong><br />
Here, DBRND_Original is an existing table and DBRND_Original_New is my staging table.<br />
Now, I am swapping the table using one rename command which performs whole swapping operation in one transaction.</p>
<pre class="crayon-plain-tag">RENAME TABLE DBRND_Original TO DBRND_Original_Backup, DBRND_Original_New To DBRND_Original;</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2018/08/mysql-how-to-swap-table-or-rename-the-table-in-one-transaction/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: Missing MySQL Service in services.msc (Windows System)</title>
		<link>https://www.dbrnd.com/2018/03/mysql-missing-mysql-service-in-services-msc-windows-system/</link>
					<comments>https://www.dbrnd.com/2018/03/mysql-missing-mysql-service-in-services-msc-windows-system/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Sat, 17 Mar 2018 16:16:21 +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[initialize mysqld]]></category>
		<category><![CDATA[Installed mysqld]]></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 Service]]></category>
		<category><![CDATA[MySQL Tips and Tricks]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7231</guid>

					<description><![CDATA[<div><img width="679" height="509" src="https://www.dbrnd.com/wp-content/uploads/2018/03/Missing-679x509.jpg" class="attachment-post-image size-post-image wp-post-image" alt="" decoding="async" fetchpriority="high" srcset="https://www.dbrnd.com/wp-content/uploads/2018/03/Missing-679x509.jpg 679w, https://www.dbrnd.com/wp-content/uploads/2018/03/Missing-850x638.jpg 850w, https://www.dbrnd.com/wp-content/uploads/2018/03/Missing.jpg 960w" sizes="(max-width: 679px) 100vw, 679px" /></div>After successful installation MySQL Server, Have you ever suffer any problem in connecting the Database? If you are not able to connect MySQL, there are multiple reasons. One is MySQL service may not configure in services.msc. In this post, I am sharing steps on how to install/configure MySQL Service. Step 1: Check the services.msc (open [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="679" height="509" src="https://www.dbrnd.com/wp-content/uploads/2018/03/Missing-679x509.jpg" class="attachment-post-image size-post-image wp-post-image" alt="" decoding="async" loading="lazy" srcset="https://www.dbrnd.com/wp-content/uploads/2018/03/Missing-679x509.jpg 679w, https://www.dbrnd.com/wp-content/uploads/2018/03/Missing-850x638.jpg 850w, https://www.dbrnd.com/wp-content/uploads/2018/03/Missing.jpg 960w" 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%2F2018%2F03%2Fmysql-missing-mysql-service-in-services-msc-windows-system%2F&amp;linkname=MySQL%3A%20Missing%20MySQL%20Service%20in%20services.msc%20%28Windows%20System%29" 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%2F03%2Fmysql-missing-mysql-service-in-services-msc-windows-system%2F&amp;linkname=MySQL%3A%20Missing%20MySQL%20Service%20in%20services.msc%20%28Windows%20System%29" 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%2F03%2Fmysql-missing-mysql-service-in-services-msc-windows-system%2F&amp;linkname=MySQL%3A%20Missing%20MySQL%20Service%20in%20services.msc%20%28Windows%20System%29" 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%2F03%2Fmysql-missing-mysql-service-in-services-msc-windows-system%2F&amp;linkname=MySQL%3A%20Missing%20MySQL%20Service%20in%20services.msc%20%28Windows%20System%29" 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%2F03%2Fmysql-missing-mysql-service-in-services-msc-windows-system%2F&amp;linkname=MySQL%3A%20Missing%20MySQL%20Service%20in%20services.msc%20%28Windows%20System%29" 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%2F03%2Fmysql-missing-mysql-service-in-services-msc-windows-system%2F&amp;linkname=MySQL%3A%20Missing%20MySQL%20Service%20in%20services.msc%20%28Windows%20System%29" 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%2F03%2Fmysql-missing-mysql-service-in-services-msc-windows-system%2F&#038;title=MySQL%3A%20Missing%20MySQL%20Service%20in%20services.msc%20%28Windows%20System%29" data-a2a-url="https://www.dbrnd.com/2018/03/mysql-missing-mysql-service-in-services-msc-windows-system/" data-a2a-title="MySQL: Missing MySQL Service in services.msc (Windows System)"></a></p><p>After successful installation MySQL Server, Have you ever suffer any problem in connecting the Database? If you are not able to connect MySQL, there are multiple reasons. </p>
<p>One is MySQL service may not configure in services.msc. In this post, I am sharing steps on how to install/configure MySQL Service. </p>
<blockquote><p>Step 1:<br />
Check the services.msc (open by pressing Windows key + R and write services.msc)<br />
If service is not present, follow two steps.</p></blockquote>
<blockquote><p>Step 2:<br />
Open Windows Command Prompt as an Administrator</p></blockquote>
<blockquote><p>Step 3:<br />
Go to ../MySQL Server 5.7/bin</p></blockquote>
<blockquote><p>Step 4: Install MySQL Service</p>
<pre class="crayon-plain-tag">mysqld --install</pre>
</p></blockquote>
<blockquote><p>Step 5: Initialize MySQL Service</p>
<pre class="crayon-plain-tag">mysqld --initialize</pre>
</p></blockquote>
<blockquote><p>Step 6:<br />
Now, MySQL Service is installed and configured so open services.msc and check the status.</p></blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2018/03/mysql-missing-mysql-service-in-services-msc-windows-system/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL: How to reset ROOT password in Windows System?</title>
		<link>https://www.dbrnd.com/2018/03/mysql-how-to-reset-root-password-in-windows-system/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Fri, 16 Mar 2018 16:16:40 +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[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[Reset Root Password]]></category>
		<category><![CDATA[ROOT Password]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=7226</guid>

					<description><![CDATA[<div><img width="354" height="225" src="https://www.dbrnd.com/wp-content/uploads/2018/03/Password-Forgot.png" class="attachment-post-image size-post-image wp-post-image" alt="Password Forgot" decoding="async" loading="lazy" /></div>In this post, I am sharing full steps on how to reset the forgotten MySQL ROOT password in Windows Operating System. When you are installing MySQL, it asks for setting up a ROOT Password which the default admin setup of your MySQL Server. I noticed that most of the people are forgetting the main ROOT [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="354" height="225" src="https://www.dbrnd.com/wp-content/uploads/2018/03/Password-Forgot.png" class="attachment-post-image size-post-image wp-post-image" alt="Password Forgot" decoding="async" loading="lazy" /></div><p><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fwww.dbrnd.com%2F2018%2F03%2Fmysql-how-to-reset-root-password-in-windows-system%2F&amp;linkname=MySQL%3A%20How%20to%20reset%20ROOT%20password%20in%20Windows%20System%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%2F2018%2F03%2Fmysql-how-to-reset-root-password-in-windows-system%2F&amp;linkname=MySQL%3A%20How%20to%20reset%20ROOT%20password%20in%20Windows%20System%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%2F2018%2F03%2Fmysql-how-to-reset-root-password-in-windows-system%2F&amp;linkname=MySQL%3A%20How%20to%20reset%20ROOT%20password%20in%20Windows%20System%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%2F2018%2F03%2Fmysql-how-to-reset-root-password-in-windows-system%2F&amp;linkname=MySQL%3A%20How%20to%20reset%20ROOT%20password%20in%20Windows%20System%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%2F2018%2F03%2Fmysql-how-to-reset-root-password-in-windows-system%2F&amp;linkname=MySQL%3A%20How%20to%20reset%20ROOT%20password%20in%20Windows%20System%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%2F2018%2F03%2Fmysql-how-to-reset-root-password-in-windows-system%2F&amp;linkname=MySQL%3A%20How%20to%20reset%20ROOT%20password%20in%20Windows%20System%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%2F2018%2F03%2Fmysql-how-to-reset-root-password-in-windows-system%2F&#038;title=MySQL%3A%20How%20to%20reset%20ROOT%20password%20in%20Windows%20System%3F" data-a2a-url="https://www.dbrnd.com/2018/03/mysql-how-to-reset-root-password-in-windows-system/" data-a2a-title="MySQL: How to reset ROOT password in Windows System?"></a></p><p>In this post, I am sharing full steps on how to reset the forgotten MySQL ROOT password in Windows Operating System. </p>
<blockquote><p>When you are installing MySQL, it asks for setting up a ROOT Password which the default admin setup of your MySQL Server.<br />
I noticed that most of the people are forgetting the main ROOT password of MySQL and then You can&#8217;t connect to server/database.</p></blockquote>
<p>I found multiple solutions, but here I am sharing two solutions. </p>
<p>One solution is given by MySQL Developer, for that please visit <a href="https://dev.mysql.com/doc/mysql-windows-excerpt/5.7/en/resetting-permissions-windows.html" rel="noopener" target an "_blank">this link:</a></p>
<p><strong>For alternative, please follow below steps: </strong></p>
<blockquote class="wp-embedded-content" data-secret="Ixwv5w255I"><p><a href="https://www.dbrnd.com/2015/08/reset-mysql-root-password-ubuntu/">How to reset MySQL root Password in Ubuntu</a></p></blockquote>
<p><iframe loading="lazy" class="wp-embedded-content" sandbox="allow-scripts" security="restricted"  src="https://www.dbrnd.com/2015/08/reset-mysql-root-password-ubuntu/embed/#?secret=Ixwv5w255I" data-secret="Ixwv5w255I" width="600" height="338" title="&#8220;How to reset MySQL root Password in Ubuntu&#8221; &#8212; Database Research &amp; Development" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe></p>
<blockquote><p>Step 1:<br />
Go to services.msc and stop the MySQL Service</p></blockquote>
<blockquote><p>Step 2:<br />
Open Windows Command Prompt as an Administrator</p></blockquote>
<blockquote><p>Step 3:<br />
Go to ../MySQL Server 5.7/bin/</p></blockquote>
<blockquote><p>Step 4: Execute this command </p>
<pre class="crayon-plain-tag">mysqld.exe -u root --skip-grant-tables</pre>
</p></blockquote>
<blockquote><p>Step 5: Start the MySQL Service</p></blockquote>
<blockquote><p>Step 6:<br />
Open a new Windows Command Prompt as an Administrator and go to MySQL/bin</p></blockquote>
<blockquote><p>Step 7:<br />
Type MySQL and press enter. Now, you are in MySQL Console. </p></blockquote>
<blockquote><p>Step 8: Reset the password</p>
<pre class="crayon-plain-tag">UPDATE user SET Password = PASSWORD('New_Password') WHERE User = 'root';</pre>
</p></blockquote>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL: Copy Database From One Server to Another Server (Using mysqldump)</title>
		<link>https://www.dbrnd.com/2017/11/mysql-copy-database-from-one-server-to-another-server-using-mysqldump/</link>
					<comments>https://www.dbrnd.com/2017/11/mysql-copy-database-from-one-server-to-another-server-using-mysqldump/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Thu, 09 Nov 2017 16:16:45 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[backup]]></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[mysqldump]]></category>
		<category><![CDATA[restore]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=6097</guid>

					<description><![CDATA[In this post, I am sharing different types of options to copy your MySQL Database from one server to another server. The migration of data, objects or database is a ubiquitous task for any DBA so as a blogger I can&#8217;t skip this kind of topics. Common and General option: Server 1: Take the backup [&#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%2F11%2Fmysql-copy-database-from-one-server-to-another-server-using-mysqldump%2F&amp;linkname=MySQL%3A%20Copy%20Database%20From%20One%20Server%20to%20Another%20Server%20%28Using%20mysqldump%29" 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%2F11%2Fmysql-copy-database-from-one-server-to-another-server-using-mysqldump%2F&amp;linkname=MySQL%3A%20Copy%20Database%20From%20One%20Server%20to%20Another%20Server%20%28Using%20mysqldump%29" 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%2F11%2Fmysql-copy-database-from-one-server-to-another-server-using-mysqldump%2F&amp;linkname=MySQL%3A%20Copy%20Database%20From%20One%20Server%20to%20Another%20Server%20%28Using%20mysqldump%29" 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%2F11%2Fmysql-copy-database-from-one-server-to-another-server-using-mysqldump%2F&amp;linkname=MySQL%3A%20Copy%20Database%20From%20One%20Server%20to%20Another%20Server%20%28Using%20mysqldump%29" 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%2F11%2Fmysql-copy-database-from-one-server-to-another-server-using-mysqldump%2F&amp;linkname=MySQL%3A%20Copy%20Database%20From%20One%20Server%20to%20Another%20Server%20%28Using%20mysqldump%29" 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%2F11%2Fmysql-copy-database-from-one-server-to-another-server-using-mysqldump%2F&amp;linkname=MySQL%3A%20Copy%20Database%20From%20One%20Server%20to%20Another%20Server%20%28Using%20mysqldump%29" 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%2F11%2Fmysql-copy-database-from-one-server-to-another-server-using-mysqldump%2F&#038;title=MySQL%3A%20Copy%20Database%20From%20One%20Server%20to%20Another%20Server%20%28Using%20mysqldump%29" data-a2a-url="https://www.dbrnd.com/2017/11/mysql-copy-database-from-one-server-to-another-server-using-mysqldump/" data-a2a-title="MySQL: Copy Database From One Server to Another Server (Using mysqldump)"></a></p><p>In this post, I am sharing different types of options to copy your MySQL Database from one server to another server.</p>
<p>The migration of data, objects or database is a ubiquitous task for any DBA so as a blogger I can&#8217;t skip this kind of topics. </p>
<p><strong>Common and General option:</strong></p>
<blockquote><p><strong>Server 1: Take the backup in .sql file</strong><br />
&#8211; -databases option adds the CREATE DATABASE in dump file, so that you can restore same backup in any other server without creating a blank database.</p>
<pre class="crayon-plain-tag">my-shell&gt; mysqldump --databases db_name &gt; mydump.sql</pre> </p>
<p><strong>Next, copy mydump.sql file from Server 1 to Server 2.</strong></p>
<p><strong>Server 2: Restore the backup</strong></p>
<pre class="crayon-plain-tag">my-shell&gt; mysql &lt; mydump.sql</pre>
</p></blockquote>
<p><strong>My favourite option:</strong></p>
<blockquote><p>Use pipe and copy the database from one server to another, without taking or moving the physical file. </p>
<pre class="crayon-plain-tag">mysqldump -uuser -ppassword db_name | mysql -hremoteserver -uremoteuser -premoteserverpassword</pre> </p>
<p><strong>For all database:</strong></p>
<pre class="crayon-plain-tag">mysqldump --all-databases -uuser -ppassword | mysql -hremoteserver -uremoteuser -premoteserverpassword</pre> </p>
</blockquote>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/11/mysql-copy-database-from-one-server-to-another-server-using-mysqldump/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL: Install MySQL Tuner to get Performance Metrice in Ubuntu 16.04</title>
		<link>https://www.dbrnd.com/2017/08/mysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04/</link>
					<comments>https://www.dbrnd.com/2017/08/mysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Wed, 02 Aug 2017 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[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[MySQL Tuner]]></category>
		<category><![CDATA[Ubuntu 16.04]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5737</guid>

					<description><![CDATA[In this post, I am showing the installation process of MySQL Tuner in Ubuntu 16.04. MySQL Tuner is a useful tool that will connect to a running MySQL instance and offer suggestions for how it can be configured for your workload. You can use this tool for running production server as well, and it will [&#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%2F08%2Fmysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20Install%20MySQL%20Tuner%20to%20get%20Performance%20Metrice%20in%20Ubuntu%2016.04" 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%2F08%2Fmysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20Install%20MySQL%20Tuner%20to%20get%20Performance%20Metrice%20in%20Ubuntu%2016.04" 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%2F08%2Fmysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20Install%20MySQL%20Tuner%20to%20get%20Performance%20Metrice%20in%20Ubuntu%2016.04" 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%2F08%2Fmysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20Install%20MySQL%20Tuner%20to%20get%20Performance%20Metrice%20in%20Ubuntu%2016.04" 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%2F08%2Fmysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20Install%20MySQL%20Tuner%20to%20get%20Performance%20Metrice%20in%20Ubuntu%2016.04" 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%2F08%2Fmysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04%2F&amp;linkname=MySQL%3A%20Install%20MySQL%20Tuner%20to%20get%20Performance%20Metrice%20in%20Ubuntu%2016.04" 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%2F08%2Fmysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04%2F&#038;title=MySQL%3A%20Install%20MySQL%20Tuner%20to%20get%20Performance%20Metrice%20in%20Ubuntu%2016.04" data-a2a-url="https://www.dbrnd.com/2017/08/mysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04/" data-a2a-title="MySQL: Install MySQL Tuner to get Performance Metrice in Ubuntu 16.04"></a></p><p>In this post, I am showing the installation process of MySQL Tuner in Ubuntu 16.04.<br />
MySQL Tuner is a useful tool that will connect to a running MySQL instance and offer suggestions for how it can be configured for your workload.</p>
<blockquote><p>You can use this tool for running production server as well, and it will give you different types of Performance Metrics and Server statistics like about the Storage, Security, Performance Parameters, Cache Parameters, InnoDB Settings, MyISAM Settings and more. </p></blockquote>
<p><strong>Install MySQL Tuner in Ubuntu 16.04:</strong></p>
<pre class="crayon-plain-tag">sudo apt-get install mysqltuner</pre> </p>
<p><strong>Execute MySQL Tuner:</strong></p>
<pre class="crayon-plain-tag">mysqltuner</pre> </p>
<p>Here, I am also sharing the sample result of my test server on which I installed and executed MySQL Tuner. </p>
<pre class="crayon-plain-tag">-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +BLACKHOLE +CSV -FEDERATED +InnoDB +MRG_MYISAM
[--] Data in InnoDB tables: 16K (Tables: 1)
[OK] Total fragmented tables: 0

-------- Security Recommendations  -------------------------------------------
[OK] There is no anonymous account in all database users
ERROR 1054 (42S22) at line 1: Unknown column 'password' in 'where clause'
[OK] All database users have passwords assigned
ERROR 1054 (42S22) at line 1: Unknown column 'password' in 'where clause'

-------- Performance Metrics -------------------------------------------------
[--] Up for: 4d 17h 35m 56s (26 q [0.000 qps], 32 conn, TX: 21K, RX: 5K)
[--] Reads / Writes: 100% / 0%
[--] Binary logging is disabled
[--] Total buffers: 192.0M global + 1.1M per thread (151 max threads)
[OK] Maximum reached memory usage: 194.1M (19.60% of installed RAM)
[OK] Maximum possible memory usage: 352.4M (35.58% of installed RAM)
[OK] Slow queries: 0% (0/26)
[OK] Highest usage of available connections: 1% (2/151)
[!!] Aborted connections: 43.75%  (14/32)
[!!] Query cache is disabled
[OK] Temporary tables created on disk: 15% (10 on disk / 64 total)
[OK] Thread cache hit rate: 93% (2 created / 32 connections)
[OK] Table cache hit rate: 25% (28 open / 109 opened)
[OK] Open file limit used: 0% (6/1K)
[OK] Table locks acquired immediately: 100% (100 immediate / 100 locks)

-------- MyISAM Metrics -----------------------------------------------------
[!!] Key buffer used: 18.2% (3M used / 16M cache)
[OK] Key buffer size / total MyISAM indexes: 16.0M/43.0K
[!!] Read Key buffer hit rate: 50.0% (6 cached / 3 reads)

-------- InnoDB Metrics -----------------------------------------------------
[--] InnoDB is enabled.
[OK] InnoDB buffer pool / data size: 128.0M/16.0K
[OK] InnoDB buffer pool instances: 1
[!!] InnoDB Used buffer: 3.55% (291 used/ 8191 total)
[!!] InnoDB Read buffer efficiency: 81.34% (1120 hits/ 1377 total)
[!!] InnoDB Write buffer efficiency: 0.00% (0 hits/ 1 total)
[OK] InnoDB log waits: 0.00% (0 waits / 2 writes)

-------- AriaDB Metrics -----------------------------------------------------
[--] AriaDB is disabled.

-------- Replication Metrics -------------------------------------------------
[--] No replication slave(s) for this server.
[--] This is a standalone server..</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/08/mysql-install-mysql-tuner-to-get-performance-metrice-in-ubuntu-16-04/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title>MySQL: How to change the default name of root User?</title>
		<link>https://www.dbrnd.com/2017/07/mysql-how-to-change-the-default-name-of-root-user/</link>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Tue, 25 Jul 2017 16:16:09 +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[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[Password]]></category>
		<category><![CDATA[root]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5693</guid>

					<description><![CDATA[When you install the MySQL, the root user is a default, and even most of the people also set the password &#8216;root&#8217;. For MySQL, username and password like root-root is a very common so hackers can easily try this combination and can attack in your database system. After the installation of MySQL Server, please don&#8217;t [&#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-how-to-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%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-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%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-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%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-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%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-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%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-change-the-default-name-of-root-user%2F&amp;linkname=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%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-change-the-default-name-of-root-user%2F&#038;title=MySQL%3A%20How%20to%20change%20the%20default%20name%20of%20root%20User%3F" data-a2a-url="https://www.dbrnd.com/2017/07/mysql-how-to-change-the-default-name-of-root-user/" data-a2a-title="MySQL: How to change the default name of root User?"></a></p><p>When you install the MySQL, the root user is a default, and even most of the people also set the password &#8216;root&#8217;. </p>
<p>For MySQL, username and password like root-root is a very common so hackers can easily try this combination and can attack in your database system. </p>
<p>After the installation of MySQL Server, please don&#8217;t forget to rename the name of the root user.<br />
In this post, I am sharing required steps for changing the name of the root user.</p>
<p><strong>Connect MySQL and check the list of users:</strong></p>
<pre class="crayon-plain-tag">mysql&gt; select user,host from mysql.user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| debian-sys-maint | localhost |
| mysql.sys        | localhost |
| root             | localhost |
+------------------+-----------+</pre> </p>
<p><strong>Rename the &#8216;root&#8217; user to &#8216;anvesh&#8217;:</strong></p>
<pre class="crayon-plain-tag">rename user 'root'@'localhost' to 'anvesh'@'localhost';</pre> </p>
<p><strong>Confirm the new user name:</strong></p>
<pre class="crayon-plain-tag">mysql&gt; select user,host from mysql.user;
+------------------+-----------+
| user             | host      |
+------------------+-----------+
| anvesh           | localhost |
| debian-sys-maint | localhost |
| mysql.sys        | localhost |
+------------------+-----------+</pre> </p>
<p><strong>Now, flush the privileges to make these changes happen:</strong></p>
<pre class="crayon-plain-tag">FLUSH PRIVILEGES;</pre> </p>
<p><strong>Now, connect with new user name:</strong></p>
<pre class="crayon-plain-tag">mysql -u anvesh -p</pre> </p>
]]></content:encoded>
					
		
		
			</item>
		<item>
		<title>MySQL: Move Data Directory to a New Location on Ubuntu 16.04</title>
		<link>https://www.dbrnd.com/2017/07/mysql-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld/</link>
					<comments>https://www.dbrnd.com/2017/07/mysql-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld/#comments</comments>
		
		<dc:creator><![CDATA[Anvesh Patel]]></dc:creator>
		<pubDate>Mon, 24 Jul 2017 16:16:27 +0000</pubDate>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Anvesh Patel]]></category>
		<category><![CDATA[AppArmor]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[database research and development]]></category>
		<category><![CDATA[datadir]]></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[mysqld]]></category>
		<guid isPermaLink="false">https://www.dbrnd.com/?p=5687</guid>

					<description><![CDATA[<div><img width="400" height="400" src="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLMoveDataDir.png" class="attachment-post-image size-post-image wp-post-image" alt="MySQL Move Data Dir" decoding="async" loading="lazy" srcset="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLMoveDataDir.png 400w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLMoveDataDir-150x150.png 150w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLMoveDataDir-300x300.png 300w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLMoveDataDir-65x65.png 65w" sizes="auto, (max-width: 400px) 100vw, 400px" /></div>In this post, I am sharing required steps to move MySQL Data Directory from old location to new location. Check the current data directory of MySQL: [crayon-6ab3d4127d319062517887/] Stop the MySQL Service: [crayon-6ab3d4127d31a212913047/] Confirm the inactive status of MySQL Service: [crayon-6ab3d4127d31b522967950/] Output: [crayon-6ab3d4127d31c899695998/] Use rsync with -av flag to copy the existing database directory to the [&#8230;]]]></description>
										<content:encoded><![CDATA[<div><img width="400" height="400" src="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLMoveDataDir.png" class="attachment-post-image size-post-image wp-post-image" alt="MySQL Move Data Dir" decoding="async" loading="lazy" srcset="https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLMoveDataDir.png 400w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLMoveDataDir-150x150.png 150w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLMoveDataDir-300x300.png 300w, https://www.dbrnd.com/wp-content/uploads/2017/07/MySQLMoveDataDir-65x65.png 65w" sizes="auto, (max-width: 400px) 100vw, 400px" /></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-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld%2F&amp;linkname=MySQL%3A%20Move%20Data%20Directory%20to%20a%20New%20Location%20on%20Ubuntu%2016.04" 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-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld%2F&amp;linkname=MySQL%3A%20Move%20Data%20Directory%20to%20a%20New%20Location%20on%20Ubuntu%2016.04" 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-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld%2F&amp;linkname=MySQL%3A%20Move%20Data%20Directory%20to%20a%20New%20Location%20on%20Ubuntu%2016.04" 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-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld%2F&amp;linkname=MySQL%3A%20Move%20Data%20Directory%20to%20a%20New%20Location%20on%20Ubuntu%2016.04" 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-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld%2F&amp;linkname=MySQL%3A%20Move%20Data%20Directory%20to%20a%20New%20Location%20on%20Ubuntu%2016.04" 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-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld%2F&amp;linkname=MySQL%3A%20Move%20Data%20Directory%20to%20a%20New%20Location%20on%20Ubuntu%2016.04" 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-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld%2F&#038;title=MySQL%3A%20Move%20Data%20Directory%20to%20a%20New%20Location%20on%20Ubuntu%2016.04" data-a2a-url="https://www.dbrnd.com/2017/07/mysql-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld/" data-a2a-title="MySQL: Move Data Directory to a New Location on Ubuntu 16.04"></a></p><p>In this post, I am sharing required steps to move MySQL Data Directory from old location to new location. </p>
<p><strong>Check the current data directory of MySQL:</strong></p>
<pre class="crayon-plain-tag">mysql&gt; select @@datadir;
+-----------------+
| @@datadir       |
+-----------------+
| /var/lib/mysql/ |
+-----------------+</pre> </p>
<p><strong>Stop the MySQL Service:</strong></p>
<pre class="crayon-plain-tag">sudo systemctl stop mysql</pre> </p>
<p><strong>Confirm the inactive status of MySQL Service:</strong> </p>
<pre class="crayon-plain-tag">sudo systemctl status mysql</pre>
<strong>Output:</strong></p>
<pre class="crayon-plain-tag">● mysql.service - MySQL Community Server
   Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Wed 2017-07-12 19:45:48 UTC; 11s ago
 Main PID: 8841 (code=exited, status=0/SUCCESS)

Jul 12 19:11:30 ip-172-31-27-19 systemd[1]: Starting MySQL Community Server...
Jul 12 19:11:31 ip-172-31-27-19 systemd[1]: Started MySQL Community Server.
Jul 12 19:45:46 ip-172-31-27-19 systemd[1]: Stopping MySQL Community Server...
Jul 12 19:45:48 ip-172-31-27-19 systemd[1]: Stopped MySQL Community Server.</pre> </p>
<p><strong>Use rsync with -av flag to copy the existing database directory to the new location:</strong></p>
<pre class="crayon-plain-tag">sudo rsync -av /var/lib/mysql /mnt/dbrnd_mysql</pre> </p>
<p><strong>Rename old MySQL Data Directory:</strong></p>
<pre class="crayon-plain-tag">sudo mv /var/lib/mysql /var/lib/mysql.backup</pre> </p>
<p><strong>Change (datadir=) parameter in MySQL Config file (mysqld.cnf) for pointing to the New Data Location:</strong></p>
<pre class="crayon-plain-tag">sudo nano /etc/mysql/mysql.conf.d/mysqld.cnf</pre>
<strong>My Sample mysqld.cnf:</strong></p>
<pre class="crayon-plain-tag">[mysqld]
#
# * Basic Settings
#
user            = mysql
pid-file        = /var/run/mysqld/mysqld.pid
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /mnt/dbrnd_mysql/mysql
tmpdir          = /tmp
lc-messages-dir = /usr/share/mysql
skip-external-locking</pre> </p>
<p><strong>Now, Check below sample error:</strong></p>
<pre class="crayon-plain-tag">Job for mysql.service failed because the control process exited with error code. See "systemctl status mysql.service" and "journalctl -xe" for details.</pre> </p>
<p><strong>To avoid above error, configure AppArmor Access Control Rules:</strong></p>
<blockquote><p><strong>AppArmor:</strong> AppArmor (&#8220;Application&#8221;) is a Linux kernel security module that allows the system administrator to restrict programs&#8217; capabilities with per-program profiles. Profiles can allow capabilities like network access, raw socket access, and the permission to read, write, or execute files on matching paths.</p></blockquote>
<p><strong>Open AppArmor for edit:</strong></p>
<pre class="crayon-plain-tag">sudo nano /etc/apparmor.d/tunables/alias</pre> </p>
<p><strong>Add new entry of new data location path:</strong></p>
<pre class="crayon-plain-tag">alias /var/lib/mysql/ -&gt; /mnt/volume-nyc1-01/mysql/,</pre>
<strong>Please check below sample output of my AppArmor:</strong><br />
Because don&#8217;t add # in new entry and also make sure that old path is there with #.</p>
<pre class="crayon-plain-tag"># ------------------------------------------------------------------
#
#    Copyright (C) 2010 Canonical Ltd.
#
#    This program is free software; you can redistribute it and/or
#    modify it under the terms of version 2 of the GNU General Public
#    License published by the Free Software Foundation.
#
# ------------------------------------------------------------------

# Alias rules can be used to rewrite paths and are done after variable
# resolution. For example, if '/usr' is on removable media:
# alias /usr/ -&gt; /mnt/usr/,
#
# Or if mysql databases are stored in /home:
# alias /var/lib/mysql/ -&gt; /var/lib/mysql/,
alias /var/lib/mysql/ -&gt; /mnt/dbrnd_mysql/mysql/,</pre> </p>
<p><strong>After change, restart the AppArmor:</strong></p>
<pre class="crayon-plain-tag">sudo systemctl restart apparmor</pre> </p>
<p><strong>Create the minimal directory structure:</strong></p>
<pre class="crayon-plain-tag">sudo mkdir /var/lib/mysql/mysql -p</pre> </p>
<p><strong>Now, Start the MySQL Service:</strong></p>
<pre class="crayon-plain-tag">sudo systemctl start mysql</pre> </p>
<p><strong>Check the status of MySQL Service:</strong></p>
<pre class="crayon-plain-tag">sudo systemctl status mysql</pre> </p>
<p><strong>Now, connect MySQL and check the new datadir location:</strong></p>
<pre class="crayon-plain-tag">mysql&gt; select @@datadir;
+-------------------------+
| @@datadir               |
+-------------------------+
| /mnt/dbrnd_mysql/mysql/ |
+-------------------------+</pre> </p>
]]></content:encoded>
					
					<wfw:commentRss>https://www.dbrnd.com/2017/07/mysql-move-data-directory-to-a-new-location-on-ubuntu-16-04-datadir-apparmor-mysqld/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
	</channel>
</rss>
