<?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>Database &#8211; Sibeesh Passion</title>
	<atom:link href="https://mail.sibeeshpassion.com/tag/database/feed/" rel="self" type="application/rss+xml" />
	<link>https://mail.sibeeshpassion.com</link>
	<description>My passion towards life</description>
	<lastBuildDate>Wed, 11 Jul 2018 16:26:07 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>/wp-content/uploads/2017/04/Sibeesh_Passion_Logo_Small.png</url>
	<title>Database &#8211; Sibeesh Passion</title>
	<link>https://mail.sibeeshpassion.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Learn to Repair Corrupt MDF File with Perfection</title>
		<link>https://mail.sibeeshpassion.com/learn-to-repair-corrupt-mdf-file-with-perfection/</link>
					<comments>https://mail.sibeeshpassion.com/learn-to-repair-corrupt-mdf-file-with-perfection/#disqus_thread</comments>
		
		<dc:creator><![CDATA[Andrew Jackson]]></dc:creator>
		<pubDate>Fri, 22 Sep 2017 17:07:34 +0000</pubDate>
				<category><![CDATA[SQL]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[repair corrupt mdf file]]></category>
		<category><![CDATA[SQL Server]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=12494</guid>

					<description><![CDATA[[toc] To get a damaged MDF file is not rare. However, the main cause behind it is that the file is prone to corruption. When this occurs, all data saved in the server database becomes inaccessible and therefore, it leads to data loss. In such circumstances, it is important to repair corrupt MDF file of server database storage. This segment will discuss how to execute the repair process. In addition, it will also give you in-depth information about MDF file, reasons, and way to repair damaged MDF file to store it in healthy form. Read further to know more. Quick [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<p>To get a damaged MDF file is not rare. However, the main cause behind it is that the file is prone to corruption. When this occurs, all data saved in the server database becomes inaccessible and therefore, it leads to data loss. In such circumstances, it is important to repair corrupt MDF file of server database storage.</p>
<p>This segment will discuss how to execute the repair process. In addition, it will also give you in-depth information about MDF file, reasons, and way to repair damaged MDF file to store it in healthy form. Read further to know more.</p>
<h2>Quick Glance on MDF File</h2>
<p>SQL Server MDF file is a relational management system of the database. Moreover, it is a primary data file of the database, which saves all the server data. Thus, you can even state it as the master database file of MS SQL Server. Every database of SQL Server would enclose at least one .mdf file.</p>
<p>It saves components like XML Indexes, Views, Indexes, Stored Procedures, Tables, Triggers, Rules, Keys, User Defined Functions, sparse columns, data types, file stream, the column set property data types. The .mdf file can be said as a primary element for managing SQL Server database.</p>
<h2>Reasons of MDF File Corruption</h2>
<p>There are various causes, which are answerable for damaging the primary file type of server.</p>
<ul>
<li>Unexpected power failure.</li>
<li>Various bugs in server.</li>
<li>Defective Operating System.</li>
<li>Sudden shutdown of the machine.</li>
<li>Issues with hard drive</li>
<li>Virus outbreaks.</li>
</ul>
<p>Thus, issues for your .mdf file revolving corrupt can be everything from malfunctioning of hardware to software and so it is necessary to fix corrupted MDF file.</p>
<h3>Technique to Repair Corrupt MDF File</h3>
<p><strong>Method 1: Inbuilt Tool</strong></p>
<p>There are some tools that make easy for users to fix corrupted MDF file of the server. Thus, make the saved data available. In fact, all these tools are series of commands in T-SQL programming language, which is called DBCC (Database Console Commands). The purpose of these statements in DBCC is to test physical and logical uniformity of MS SQL Server database files and fix troubling problems that continue.</p>
<p>DBCC CHECKDB is a command via which you can simply check the logical and physical integrity of all objects in precise MS SQL Server database. You can do it by implementing the mentioned operations successively:</p>
<ul>
<li>Run DBCC CHECKALLOC command in the database.</li>
<li>Run DBCC CHECKCATALOG command in the database.</li>
<li>Run DBCC CHECKTABLE on every view &amp; table in the database.</li>
<li>Verifying content of every indexed view present in the database.</li>
<li>Validating link-level constancy among table Metadata, file system directories files while saving varbinary (max) data utilizing FILESTREAM in the file system.</li>
<li>Confirming Service Broker data in database.</li>
<p>Once the above steps to repair damaged MDF file is completed then, if the application finds any issues of corruption or any errors, it recommends users have the usage of various recover options for fixing troublesome problems. The recover or repair options are:</p>
<li><strong>REPAIR_FAST</strong></li>
<p>It preserves syntax for compatibility of backward only; no repair actions are executed in definite. The syntax for this, Repair option is: DBCC CHECKDB (‘DB Name’, REPAIR_FAST).</p>
<li><strong>REPAIR_REBUILD</strong></li>
<p>This option of repair implements repair process, which scarcely has potentials of data loss. This can do quick repairs like repair of missing rows in non-clustered indexes, even time-consuming repairs like the rebuilding of indexes. The syntax is DBCC CHECKDB (‘DB Name’, REPAIR_REBUILD).</p>
<li><strong>REPAIR_ALLOW_DATA_LOSS</strong></li>
<p>This command creates an effort to fix all the issues, which are reported. However, it can root cause the loss of data as specified in repair command itself. The syntax is: DBCC CHECKDB (‘DB Name’, REPAIR_ALLOW_DATA_LOSS).</p>
</ul>
<h3>Limitations:</h3>
<ol>
<li>The specific database should be in single-user mode to be able to execute either of three commands of repair.</li>
<li>DBCC repair commands are not authenticated for memory-optimized tables.</li>
</ol>
<h3>Method 2: Trouble-Free Solution</h3>
<p>There can be a possibility that when your SQL Server database MDF file is corrupt and when you try to connect to SQL Server you will find that it is marked as SUSPECT. During such scenarios or the above discussed, you will not be able to connect to the database. To repair corrupt SQL Server MDF database file best option is to restore from a recent full database backup available.</p>
<p>If no recent backup available in such cases best possible approach is to repair corrupted MDF file of Microsoft SQL Server 2000, 2005, 2008, 2012 and 2016 with <strong><a href="https://www.systoolsgroup.com/sql-recovery.html" target="_blank">SQL Database Repair Tool</a></strong>. One of the most highly used and recommended software to repair corrupt SQL MDF file with the assurance of 99% guaranteed recovery.
</p>
<h3>Observational Verdict</h3>
<p>We have gone through the possible solution which you need to follow to recover a database in case MDF file get corrupted or database marked as SUSPECT. We serve you with the best of the best ways to repair corrupt MDF file. So, Hurry! What are you waiting for? You are raising the bar and we are taking it forward with the all in one and probably the best of solution repair damaged MDF database file.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/learn-to-repair-corrupt-mdf-file-with-perfection/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SQL Interview Questions And Answers</title>
		<link>https://mail.sibeeshpassion.com/sql-interview-questions-and-answers/</link>
					<comments>https://mail.sibeeshpassion.com/sql-interview-questions-and-answers/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Sat, 24 Oct 2015 06:38:39 +0000</pubDate>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Career Advice]]></category>
		<category><![CDATA[SQL Interview Questions And Answers]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10834</guid>

					<description><![CDATA[In this article we will discuss about the most asked SQL interview questions and answers. If you need to know other interview questions and answers, I strongly recommend to follow this link: Interview Questions. Now in this post we are going to share the interview questions or the information which you must know as a programmer or a developer, especially if you are a Dot Net developer. We will explain few questions here, if you still need some additional information on SQL, you can read here: SQL . I hope you will like this article. Background I am a dot [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>In this article we will discuss about the most asked <a href="http://sibeeshpassion.com/category/sql/" target="_blank">SQL </a>interview questions and answers. If you need to know other interview questions and answers, I strongly recommend to follow this link: <a href="http://sibeeshpassion.com/category/interview/" target="_blank">Interview Questions</a>. Now in this post we are going to share the interview questions or the information which you must know as a programmer or a developer, especially if you are a Dot Net developer. We will explain few questions here, if you still need some additional information on SQL, you can read here: <a href="http://sibeeshpassion.com/category/sql/" target="_blank">SQL </a>. I hope you will like this article.</p>
<p><strong>Background</strong></p>
<p>I am a dot net developer. As a dot net developer, there are so many things that I must be aware of. I am sharing those in the form of articles, you can always read my other interview questions here in the below links.</p>
<li><a href="http://sibeeshpassion.com/dot-net-interview-questions-for-experienced-and-fresher/" target="_blank">Interview Questions For Experienced and Beginner .NET Professionals</a></li>
<li><a href="http://sibeeshpassion.com/infosys-interview-questions-for-dotnet-professionals/" target="_blank">Infosys Interview Questions For DotNet Professionals</a></li>
<p>So shall we now discuss about SQL interview questions?</p>
<p><strong>SQL Interview Questions</strong></p>
<p><strong>What are the types of Joins in SQL? Explain?</strong></p>
<li>INNER JOIN</li>
<p>Returns all rows when there is at least one match in BOTH tables </p>
<li>LEFT JOIN</li>
<p>Return all rows from the left table, and the matched rows from the right table </p>
<li>RIGHT JOIN</li>
<p>Return all rows from the right table, and the matched rows from the left table </p>
<li>FULL JOIN</li>
<p>Return all rows when there is a match in ONE of the tables </p>
<p><strong>What is the default join in SQL? Give an example query?</strong></p>
<p>The default join is INNER JOIN. </p>
<p>Example: </p>
<p>[sql]<br />
SELECT column_name(s)<br />
FROM table1<br />
INNER JOIN table2<br />
ON table1.column_name=table2.column_name;<br />
[/sql]</p>
<p><strong>Describe all the joins with examples in SQL?</strong></p>
<p><em>SQL LEFT JOIN </em></p>
<p>The LEFT JOIN keyword returns all rows from the left table (table1), with the matching rows in the right table (table2). The result is NULL in the right side when there is no match. </p>
<p>[sql]<br />
SQL LEFT JOIN Syntax<br />
SELECT column_name(s)<br />
FROM table1<br />
LEFT JOIN table2<br />
ON table1.column_name=table2.column_name;<br />
[/sql]</p>
<p><em>SQL RIGHT JOIN </em></p>
<p>The right join returns all the rows in the right table ie table 2 with the matching ones in the left table(table1). </p>
<p>[sql]<br />
SELECT column_name(s)<br />
FROM table1<br />
RIGHT JOIN table2<br />
ON table1.column_name=table2.column_name;<br />
[/sql]</p>
<p><em>SQL FULL OUTER </em></p>
<p>The full join returns all rows from the left table (table1) and from the right table (table2) </p>
<p>[sql]<br />
SELECT column_name(s)<br />
FROM table1<br />
FULL OUTER JOIN table2<br />
ON table1.column_name=table2.column_name;<br />
[/sql]</p>
<p><strong>What is Union And Union All ? Explain the differences?</strong></p>
<p><em>SQL UNION  </em></p>
<p>The UNION operator is used to combine the result-set of two or more SELECT statements. </p>
<p>Notice that each SELECT statement within the UNION must have the same number of columns. The columns must also have similar data types. Also, the columns in each SELECT statement must be in the same order. </p>
<blockquote><p>Note: The UNION operator selects only distinct values by default.  </p></blockquote>
<p>[sql]<br />
SELECT column_name(s) FROM table1<br />
UNION<br />
SELECT column_name(s) FROM table2;<br />
[/sql]</p>
<p><em>SQL UNION ALL</em> </p>
<p>[sql]<br />
SQL UNION ALL Syntax<br />
SELECT column_name(s) FROM table1<br />
UNION ALL<br />
SELECT column_name(s) FROM table2;<br />
[/sql]</p>
<blockquote><p>Allows duplicate values. </p></blockquote>
<p><strong>Differentiate Clustered and Non clustered Index in SQL?</strong></p>
<p>A clustered index is one in which the index&#8217;s order is arranged according to the physical order of rows in the table. Due to this reason there can only be one clustered index per table, usually this is the primary key. </p>
<p>A non clustered index is one in which the order of index is not in accordance with the physical order of rows in the table. </p>
<p><em>Create Index Syntax </em></p>
<p>[sql]<br />
CREATE INDEX [ CLUSTERED | NONCLUSTERED ] PIndex ON Persons (LastName,FirstName)<br />
[/sql]</p>
<p><strong>Explain the difference between Stored Procedure and User Defined Function?</strong></p>
<p><em>Stored Procedure </em></p>
<p>Stored procedures are reusable code in database which is compiled for first time and its execution plan saved. The compiled code is executed when everytime its called. You  </p>
<p><em>Function </em></p>
<p>Function is a database object in SQL Server. Basically it is a set of SQL statements that accepts only input parameters, perform actions and return the result. Function can return only single value or a table. We can’t use function to Insert, Update, Delete records in the database table(s). It is compiled eveyrtime its invoked.  </p>
<p><em>Basic Difference </em></p>
<p>Function must return a value but in Stored Procedure it is optional( Procedure can return zero or n values).<br />
Functions can have only input parameters for it whereas Procedures can have input/output parameters .<br />
Functions can be called from Procedure whereas Procedures cannot be called from Function </p>
<p><em>Advanced Difference </em></p>
<p>Procedure allows SELECT as well as DML(INSERT/UPDATE/DELETE) statement in it whereas Function allows only SELECT statement in it.<br />
Procedures cannot be utilized in a SELECT statement whereas Function can be embedded in a SELECT statement.<br />
Stored Procedures cannot be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section whereas Function can be.<br />
The most important feature of stored procedures over function is to retention and reuse the execution plan while in case of function it will be compiled every time. </p>
<p>Functions that return tables can be treated as another rowset. This can be used in JOINs with other tables.<br />
Inline Function can be though of as views that take parameters and can be used in JOINs and other Rowset operations.<br />
Exception can be handled by try-catch block in a Procedure whereas try-catch block cannot be used in a Function.<br />
We can use transactions in stored procedure but not in functions.  </p>
<p>That&#8217;s all. Have a great day.</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed? Could you find this post as useful? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I can.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/sql-interview-questions-and-answers/feed/</wfw:commentRss>
			<slash:comments>12</slash:comments>
		
		
			</item>
		<item>
		<title>Link Your MySQL Database To Azure Virtual Machine And WordPress</title>
		<link>https://mail.sibeeshpassion.com/link-your-mysql-database-to-azure-virtual-machine-and-wordpress/</link>
					<comments>https://mail.sibeeshpassion.com/link-your-mysql-database-to-azure-virtual-machine-and-wordpress/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Thu, 24 Sep 2015 05:35:02 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Virtual Machine]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[Adding end points in Azure Virtual Machine]]></category>
		<category><![CDATA[Azure Virtual Machine]]></category>
		<category><![CDATA[Change Virtual Machine Endpoints]]></category>
		<category><![CDATA[Changing the Firewall Settings In Azure Virtual Machine]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10648</guid>

					<description><![CDATA[This article explains how you can link your existing MySQL database to a Azure virtual machine and configure in wordpress. Once your database and wordpress website id ready you can go ahead and link your DB to wordpress and axure virtual machine. If you need to back up and restore your clear db MySQL database in a virtual machine in Azure, I suggest you to read Back Up your ClearDB and restore in Azure. If you are new to azure virtual machine, I strongly recommend you to read here: Create Virtual Machine In Azure. You can also find how to [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This article explains how you can link your existing MySQL database to a Azure virtual machine and configure in wordpress. Once your database and wordpress website id ready you can go ahead and link your DB to wordpress and axure virtual machine.  If you need to back up and restore your clear db <a href="http://sibeeshpassion.com/category/mysql/" target="_blank">MySQL </a>database in a virtual machine in <a href="http://sibeeshpassion.com/tag/azure/" target="_blank">Azure</a>, I suggest you to read <a href="http://sibeeshpassion.com/back-up-your-cleardb-and-restore-in-azure-virtual-machine-mysql/" target="_blank">Back Up your ClearDB and restore in Azure</a>. If you are new to azure virtual machine, I strongly recommend you to read here: <a href="http://sibeeshpassion.com/create-virtual-machine-in-azure/" target="_blank">Create Virtual Machine In Azure</a>. You can also find how to install MySQL in Azure Virtual Machine here <a href="http://sibeeshpassion.com/install-mysql-in-azure-virtual-machine/" target="_blank">Install MySQL in Azure </a> . I hope you will like this.</p>
<p>If you are new to azure, I recommend you to read here: <a href="http://sibeeshpassion.com/category/azure/" target="_blank">Azure </a></p>
<p><strong>Background</strong></p>
<p>I hope you read my articles related to <a href="http://sibeeshpassion.com/category/virtual-machine/" target="_blank">Virtual Machines </a>in azure. If not, please read those. I was being limited to use only 20 MB size since one of the MSDN subscription was providing me ClearDB. So I thought of creating a virtual machine and install MySQL. Then I restored my previous Database to my new Database. Here in this article, I will share you the steps to link the database you created to azure virtual machine and wordpress.</p>
<p><strong>Steps to Back Up your ClearDB and restore</strong></p>
<p>Login to your azure portal <a href="https://manage.windowsazure.com" target="_blank">https://manage.windowsazure.com</a></p>
<p>Login to your Azure <a href="http://sibeeshpassion.com/create-virtual-machine-in-azure/" target="_blank">Virtual Machine</a></p>
<p>Hope you have already installed MySQL in your Virtual Machine. If so, we are ready to go.</p>
<p>First thing we need to do is to add the end points in our Azure virtual machine. To do so you need to follow the below steps.</p>
<p><strong>Add end points in Azure virtual machine</strong></p>
<p>Go to your virtual machine in azure management portal. </p>
<div id="attachment_10680" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL15.png"><img fetchpriority="high" decoding="async" aria-describedby="caption-attachment-10680" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL15-1024x486.png" alt="Adding end points in Azure Virtual Machine" width="634" height="301" class="size-large wp-image-10680" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL15-1024x486.png 1024w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL15-300x142.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL15-768x364.png 768w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL15-400x190.png 400w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL15.png 1160w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-10680" class="wp-caption-text">Adding end points in Azure Virtual Machine</p></div>
<p>Now click on the end points as shown in the preceding image.</p>
<div id="attachment_10681" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL16-e1443070554867.png"><img decoding="async" aria-describedby="caption-attachment-10681" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL16-e1443070554867.png" alt="Adding end points in Azure Virtual Machine" width="650" height="190" class="size-full wp-image-10681" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL16-e1443070554867.png 650w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL16-e1443070554867-300x88.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL16-e1443070554867-400x117.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10681" class="wp-caption-text">Adding end points in Azure Virtual Machine</p></div>
<p>Click on the add option in the footer area.</p>
<div id="attachment_10682" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL17.png"><img decoding="async" aria-describedby="caption-attachment-10682" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL17-1024x59.png" alt="Adding end points in Azure Virtual Machine" width="634" height="37" class="size-large wp-image-10682" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL17-1024x59.png 1024w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL17-300x17.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL17-768x44.png 768w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL17-400x23.png 400w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL17.png 1157w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-10682" class="wp-caption-text">Adding end points in Azure Virtual Machine</p></div>
<p>Now you will be getting a pop up, in that please click on the <em>Add standalone end points</em>.</p>
<div id="attachment_10683" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL18-e1443070721887.png"><img decoding="async" aria-describedby="caption-attachment-10683" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL18-e1443070721887.png" alt="Adding end points in Azure Virtual Machine" width="650" height="532" class="size-full wp-image-10683" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL18-e1443070721887.png 650w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL18-e1443070721887-300x246.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL18-e1443070721887-400x327.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10683" class="wp-caption-text">Adding end points in Azure Virtual Machine</p></div>
<p>In the given area, please select MySQL as name and TCP as protocol. Port should be the one we did it while configuring the MySQL. For example 3306. I suggest you to do not edit in that area.</p>
<div id="attachment_10684" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL19-e1443070904219.png"><img decoding="async" aria-describedby="caption-attachment-10684" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL19-e1443070904219.png" alt="Adding end points in Azure Virtual Machine" width="650" height="535" class="size-full wp-image-10684" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL19-e1443070904219.png 434w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL19-e1443070904219-300x247.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL19-e1443070904219-400x329.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10684" class="wp-caption-text">Adding end points in Azure Virtual Machine</p></div>
<p>Click on the tick icon once you have made entry for the required fields. Then you can see the progression and once it is completed, you will get a message as follows.</p>
<div id="attachment_10685" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL20.png"><img decoding="async" aria-describedby="caption-attachment-10685" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL20-1024x111.png" alt="Adding end points in Azure Virtual Machine" width="634" height="69" class="size-large wp-image-10685" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL20-1024x111.png 1024w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL20-300x32.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL20-768x83.png 768w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL20-400x43.png 400w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL20.png 1167w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-10685" class="wp-caption-text">Adding end points in Azure Virtual Machine</p></div>
<p>So we have successfully created the end points for our virtual machine MySQL. The next step is, to change some settings in the firewall in our virtual machine. Please do this with some care. It is very much important. </p>
<p><strong>Setting the firewall configuration in Azure virtual machine</strong></p>
<p>Go to the start menu and type power shell. You will be given some search results.</p>
<div id="attachment_10686" style="width: 339px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL21.png"><img decoding="async" aria-describedby="caption-attachment-10686" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL21.png" alt="Setting the firewall configuration in Azure virtual machine" width="329" height="539" class="size-full wp-image-10686" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL21.png 329w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL21-183x300.png 183w" sizes="(max-width: 329px) 100vw, 329px" /></a><p id="caption-attachment-10686" class="wp-caption-text">Setting the firewall configuration in Azure virtual machine</p></div>
<p>Now you can see a command window with the name of logged in user as shown in the preceding image.</p>
<div id="attachment_10687" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL22-e1443071556733.png"><img decoding="async" aria-describedby="caption-attachment-10687" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL22-e1443071556733.png" alt="Setting the firewall configuration in Azure virtual machine" width="650" height="477" class="size-full wp-image-10687" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL22-e1443071556733.png 486w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL22-e1443071556733-300x220.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL22-e1443071556733-400x294.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10687" class="wp-caption-text">Setting the firewall configuration in Azure virtual machine</p></div>
<p>The next step is a bit complex one. You need to enter a complex command which is shown here.</p>
<div id="attachment_10688" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL23-e1443071662673.png"><img decoding="async" aria-describedby="caption-attachment-10688" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL23-e1443071662673.png" alt="Setting the firewall configuration in Azure virtual machine" width="650" height="41" class="size-full wp-image-10688" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL23-e1443071662673.png 650w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL23-e1443071662673-300x19.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL23-e1443071662673-400x25.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10688" class="wp-caption-text">Setting the firewall configuration in Azure virtual machine</p></div>
<p>For your convenience I am giving the command as below.</p>
<p>[sql]<br />
New-NetFirewallRule -DisplayName &quot;MySQL56&quot; -Direction Indound -Protocol TCP -LocalPort 3306 -Action Allow -Profile Public<br />
[/sql]</p>
<p>You can type the command as shown below.</p>
<div id="attachment_10689" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL24-e1443071814487.png"><img decoding="async" aria-describedby="caption-attachment-10689" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL24-e1443071814487.png" alt="Setting firewall in azure virtual machine" width="650" height="474" class="size-full wp-image-10689" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL24-e1443071814487.png 650w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL24-e1443071814487-300x219.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL24-e1443071814487-400x292.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10689" class="wp-caption-text">Setting firewall in azure virtual machine</p></div>
<p>And if you do the above step correctly, I am sure you will be given a result as follows.</p>
<div id="attachment_10690" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL25-e1443071893874.png"><img decoding="async" aria-describedby="caption-attachment-10690" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL25-e1443071893874.png" alt="Setting firewall in azure virtual machine" width="650" height="307" class="size-full wp-image-10690" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL25-e1443071893874.png 650w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL25-e1443071893874-300x142.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL25-e1443071893874-400x189.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10690" class="wp-caption-text">Setting firewall in azure virtual machine</p></div>
<p>Wow, we have done the settings needed now.</p>
<p>Now we need to change some settings in our wordpress configuration. As you all know the wordpress configuration is in the file called wp-config.php. So we are going to change the configuration in that file.</p>
<p><strong>Changing the configuration to new settings in wordpress</strong></p>
<p>Again go to your manage azure page, click the web application you need to change the settings.</p>
<div id="attachment_10691" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL26.png"><img decoding="async" aria-describedby="caption-attachment-10691" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL26-1024x505.png" alt="Changing the configuration to new settings in wordpress" width="634" height="313" class="size-large wp-image-10691" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL26-1024x505.png 1024w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL26-300x148.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL26-768x379.png 768w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL26-400x197.png 400w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL26.png 1062w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-10691" class="wp-caption-text">Changing the configuration to new settings in wordpress</p></div>
<p>Now go to the dashboard and click on edit in visual studio on-line.</p>
<div id="attachment_10692" style="width: 282px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL91.png"><img decoding="async" aria-describedby="caption-attachment-10692" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL91.png" alt="Changing the configuration to new settings in wordpress" width="272" height="379" class="size-full wp-image-10692" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL91.png 272w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL91-215x300.png 215w" sizes="(max-width: 272px) 100vw, 272px" /></a><p id="caption-attachment-10692" class="wp-caption-text">Changing the configuration to new settings in wordpress</p></div>
<p>You can see your wordpress files now. Click on the wp-config.php. </p>
<div id="attachment_10693" style="width: 329px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL27.png"><img decoding="async" aria-describedby="caption-attachment-10693" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL27.png" alt="Changing the configuration to new settings in wordpress" width="319" height="632" class="size-full wp-image-10693" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL27.png 319w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL27-151x300.png 151w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL27-303x600.png 303w" sizes="(max-width: 319px) 100vw, 319px" /></a><p id="caption-attachment-10693" class="wp-caption-text">Changing the configuration to new settings in wordpress</p></div>
<p>It is always better to take a back up or copy of the wp-config.php, so that you can revert back to your clearDB configuration whenever you want. I strongly recommend you to do this step.</p>
<div id="attachment_10694" style="width: 309px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL28.png"><img decoding="async" aria-describedby="caption-attachment-10694" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL28.png" alt="Changing the configuration to new settings in wordpress" width="299" height="225" class="size-full wp-image-10694" /></a><p id="caption-attachment-10694" class="wp-caption-text">Changing the configuration to new settings in wordpress</p></div>
<p>You can rename the pasted file, just right click on the file and click rename.</p>
<div id="attachment_10695" style="width: 293px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL29.png"><img decoding="async" aria-describedby="caption-attachment-10695" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL29.png" alt="Changing the configuration to new settings in wordpress" width="283" height="218" class="size-full wp-image-10695" /></a><p id="caption-attachment-10695" class="wp-caption-text">Changing the configuration to new settings in wordpress</p></div>
<p>As you can see in the below image, I have given the name as ClearDB-Wp-Config.php.</p>
<div id="attachment_10696" style="width: 271px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL30.png"><img decoding="async" aria-describedby="caption-attachment-10696" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL30.png" alt="Changing the configuration to new settings in wordpress" width="261" height="176" class="size-full wp-image-10696" /></a><p id="caption-attachment-10696" class="wp-caption-text">Changing the configuration to new settings in wordpress</p></div>
<p>Open your wp-config.php and change the MySQL host name.</p>
<div id="attachment_10697" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL31-e1443072600781.png"><img decoding="async" aria-describedby="caption-attachment-10697" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL31-e1443072600781.png" alt="Changing the configuration to new settings in wordpress" width="650" height="35" class="size-full wp-image-10697" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL31-e1443072600781.png 650w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL31-e1443072600781-300x16.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL31-e1443072600781-400x22.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10697" class="wp-caption-text">Changing the configuration to new settings in wordpress</p></div>
<p>Now add the port number in the host name because it listen that port.</p>
<div id="attachment_10698" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL32-e1443072686568.png"><img decoding="async" aria-describedby="caption-attachment-10698" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL32-e1443072686568.png" alt="Changing the configuration to new settings in wordpress" width="650" height="42" class="size-full wp-image-10698" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL32-e1443072686568.png 650w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL32-e1443072686568-300x19.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL32-e1443072686568-400x26.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10698" class="wp-caption-text">Changing the configuration to new settings in wordpress</p></div>
<p>Please do not forget to change the database name, user name , password too. </p>
<p>Now I am sure your blog with new MySQL database will be running . Keep blogging. Cheers!.</p>
<p><strong>Conclusion</strong></p>
<p>Did I miss anything that you may think which is needed?.Have you ever tried virtual machine in azure?. If not, I strongly recommend that. So we have successfully configured our new MySQL database to the Azure virtual machine and wordpress. We have also done the firewall changes needed in virtual machine. I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<p><strong>Your turn. What do you think?</strong></p>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I am able to.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/link-your-mysql-database-to-azure-virtual-machine-and-wordpress/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Back Up your ClearDB and restore in Azure Virtual Machine MySQL</title>
		<link>https://mail.sibeeshpassion.com/back-up-your-cleardb-and-restore-in-azure-virtual-machine-mysql/</link>
					<comments>https://mail.sibeeshpassion.com/back-up-your-cleardb-and-restore-in-azure-virtual-machine-mysql/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Fri, 18 Sep 2015 10:57:02 +0000</pubDate>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Virtual Machine]]></category>
		<category><![CDATA[Azure Virtual Machine]]></category>
		<category><![CDATA[Back Up your ClearDB]]></category>
		<category><![CDATA[Restore ClearDB]]></category>
		<category><![CDATA[Restore MySQL]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=10629</guid>

					<description><![CDATA[[toc] Introduction This article explains how you can back up and restore your clear db MySQL database in a virtual machine in Azure. If you are new to azure virtual machine, I strongly recommend you to read here: Create Virtual Machine In Azure. You can also find how to install MySQL in Azure Virtual Machine here Install MySQL in Azure . I hope you will like this. If you are new to azure, I recommend you to read here: Azure Background I hope you read my articles related to Virtual Machines in azure. If not, please read those. I was [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>[toc]</p>
<h3>Introduction</h3>
<p>This article explains how you can back up and restore your clear db <a href="http://sibeeshpassion.com/category/mysql/" target="_blank">MySQL </a>database in a virtual machine in <a href="http://sibeeshpassion.com/tag/azure/" target="_blank">Azure</a>. If you are new to azure virtual machine, I strongly recommend you to read here: <a href="http://sibeeshpassion.com/create-virtual-machine-in-azure/" target="_blank">Create Virtual Machine In Azure</a>. You can also find how to install MySQL in Azure Virtual Machine here <a href="http://sibeeshpassion.com/install-mysql-in-azure-virtual-machine/" target="_blank">Install MySQL in Azure </a> . I hope you will like this.</p>
<p>If you are new to azure, I recommend you to read here: <a href="http://sibeeshpassion.com/category/azure/" target="_blank">Azure </a></p>
<h3>Background</h3>
<p>I hope you read my articles related to <a href="http://sibeeshpassion.com/category/virtual-machine/" target="_blank">Virtual Machines </a>in azure. If not, please read those. I was being limited to use only 20 MB size since one of the MSDN subscription was providing me ClearDB. So I thought of creating a virtual machine and install MySQL. Then I restored my previous Database to my new Database. Here in this article, I will share you the steps to back up and restore your database. </p>
<h3>Steps to Back Up your ClearDB and restore</h3>
<p>Login to your azure portal <a href="https://manage.windowsazure.com" target="_blank">https://manage.windowsazure.com</a></p>
<p>Login to your Azure <a href="http://sibeeshpassion.com/create-virtual-machine-in-azure/" target="_blank">Virtual Machine</a></p>
<p>Hope you have already installed MySQL in your Virtual Machine. If so, we are ready to go.</p>
<p>Go to start menu, and type MySQL, you will be shown some results. Click on the MySQL command line section.&#8217;</p>
<div id="attachment_10632" style="width: 363px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL1.png"><img decoding="async" aria-describedby="caption-attachment-10632" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL1.png" alt="Back Up your ClearDB and restore in Azure Virtual Machine MySQL" width="353" height="461" class="size-full wp-image-10632" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL1.png 353w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL1-230x300.png 230w" sizes="(max-width: 353px) 100vw, 353px" /></a><p id="caption-attachment-10632" class="wp-caption-text">Back Up your ClearDB and restore in Azure Virtual Machine MySQL</p></div>
<p>Provide your MySQL password.</p>
<div id="attachment_10633" style="width: 603px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL2.png"><img decoding="async" aria-describedby="caption-attachment-10633" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL2.png" alt="Back Up your ClearDB and restore in Azure Virtual Machine MySQL" width="593" height="339" class="size-full wp-image-10633" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL2.png 593w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL2-300x172.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL2-400x229.png 400w" sizes="(max-width: 593px) 100vw, 593px" /></a><p id="caption-attachment-10633" class="wp-caption-text">Back Up your ClearDB and restore in Azure Virtual Machine MySQL</p></div>
<p>You will be getting a welcome message as shown below.</p>
<div id="attachment_10634" style="width: 602px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL3.png"><img decoding="async" aria-describedby="caption-attachment-10634" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL3.png" alt="Back Up your ClearDB and restore in Azure Virtual Machine MySQL" width="592" height="344" class="size-full wp-image-10634" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL3.png 592w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL3-300x174.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL3-400x232.png 400w" sizes="(max-width: 592px) 100vw, 592px" /></a><p id="caption-attachment-10634" class="wp-caption-text">Back Up your ClearDB and restore in Azure Virtual Machine MySQL</p></div>
<p>Create a database by executing a query as follows. </p>
<p>[sql]<br />
CREATE DATABASE DATABASENAME;<br />
[/sql]</p>
<div id="attachment_10635" style="width: 600px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL4.png"><img decoding="async" aria-describedby="caption-attachment-10635" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL4.png" alt="Back Up your ClearDB and restore in Azure Virtual Machine MySQL" width="590" height="336" class="size-full wp-image-10635" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL4.png 590w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL4-300x171.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL4-400x228.png 400w" sizes="(max-width: 590px) 100vw, 590px" /></a><p id="caption-attachment-10635" class="wp-caption-text">Back Up your ClearDB and restore in Azure Virtual Machine MySQL</p></div>
<p>Go to start again, type cmd, right click and run as administrator on the result as follows.</p>
<div id="attachment_10636" style="width: 350px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL5.png"><img decoding="async" aria-describedby="caption-attachment-10636" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL5.png" alt="Back Up your ClearDB and restore in Azure Virtual Machine MySQL" width="340" height="395" class="size-full wp-image-10636" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL5.png 340w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL5-258x300.png 258w" sizes="(max-width: 340px) 100vw, 340px" /></a><p id="caption-attachment-10636" class="wp-caption-text">Back Up your ClearDB and restore in Azure Virtual Machine MySQL</p></div>
<p>Go to MySQL bin folder by executing the commands as shown in the below image.</p>
<div id="attachment_10637" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL6-e1442569873148.png"><img decoding="async" aria-describedby="caption-attachment-10637" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL6-e1442569873148.png" alt="Back Up your ClearDB and restore in Azure Virtual Machine MySQL" width="650" height="329" class="size-full wp-image-10637" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL6-e1442569873148.png 650w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL6-e1442569873148-300x152.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL6-e1442569873148-400x202.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10637" class="wp-caption-text">Back Up your ClearDB and restore in Azure Virtual Machine MySQL</p></div>
<p>Before going through the back up process, we need to make sure that our website related files can be opened with on-line <a href="http://sibeeshpassion.com/category/visual-studio/" target="_blank">visual studio</a>.</p>
<p>For that you need to follow the below steps.</p>
<p>Go to your windows azure portal, click on the web application you need to edit. Once you done that, you can see the dashboard for that web application. Click on the configure.</p>
<div id="attachment_10638" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL7-e1442570329396.png"><img decoding="async" aria-describedby="caption-attachment-10638" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL7-e1442570329396.png" alt="Back Up And Restore Your Old MySQL Database to New" width="650" height="331" class="size-full wp-image-10638" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL7-e1442570329396.png 650w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL7-e1442570329396-300x153.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL7-e1442570329396-400x204.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10638" class="wp-caption-text">Back Up And Restore Your Old MySQL Database to New Database</p></div>
<p>Scroll down and switch on edit in visual studio on-line option.</p>
<div id="attachment_10639" style="width: 565px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL8.png"><img decoding="async" aria-describedby="caption-attachment-10639" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL8.png" alt="Back Up And Restore Your Old MySQL Database to New Database" width="555" height="197" class="size-full wp-image-10639" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL8.png 555w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL8-300x106.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL8-400x142.png 400w" sizes="(max-width: 555px) 100vw, 555px" /></a><p id="caption-attachment-10639" class="wp-caption-text">Back Up And Restore Your Old MySQL Database to New Database</p></div>
<p>Now if you go to the options given in your dashboards right area, you can see edit in visual studio on-line option.</p>
<div id="attachment_10640" style="width: 282px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL9.png"><img decoding="async" aria-describedby="caption-attachment-10640" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL9.png" alt="Back Up And Restore Your Old MySQL Database to New Database" width="272" height="379" class="size-full wp-image-10640" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL9.png 272w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL9-215x300.png 215w" sizes="(max-width: 272px) 100vw, 272px" /></a><p id="caption-attachment-10640" class="wp-caption-text">Back Up And Restore Your Old MySQL Database to New Database</p></div>
<p>Just click on that option, and you will be opened visual studio on-line with your application files.</p>
<div id="attachment_10641" style="width: 644px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL10.png"><img decoding="async" aria-describedby="caption-attachment-10641" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL10-1024x513.png" alt="Back Up And Restore Your Old MySQL Database to New Database" width="634" height="318" class="size-large wp-image-10641" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL10-1024x513.png 1024w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL10-300x150.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL10-768x385.png 768w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL10-400x200.png 400w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL10.png 1180w" sizes="(max-width: 634px) 100vw, 634px" /></a><p id="caption-attachment-10641" class="wp-caption-text">Back Up And Restore Your Old MySQL Database to New Database</p></div>
<p>Now go back to your command prompt in your virtual machine and type a command as follows.</p>
<div id="attachment_10643" style="width: 566px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL11.png"><img decoding="async" aria-describedby="caption-attachment-10643" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL11.png" alt="Back Up And Restore Your Old MySQL Database to New Database" width="556" height="34" class="size-full wp-image-10643" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL11.png 556w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL11-300x18.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL11-400x24.png 400w" sizes="(max-width: 556px) 100vw, 556px" /></a><p id="caption-attachment-10643" class="wp-caption-text">Back Up And Restore Your Old MySQL Database to New Database</p></div>
<p>In the above command, what we do is, creating back up from our old database to a new file . Make sure that you have given the correct details. </p>
<p> 1. User Name<br />
 2. Host Name<br />
 3. Database Name</p>
<p>These information you can get from the <em>wp-config.php</em> file from your web application folder. Remember we have enabled open with visual studio on-line option? Please go back to that and copy the needed information from <em>wp-config.php</em> file.</p>
<p>So once you execute that command you can get a script file in your c folder, In my case I gave the path as C and the file name as myolddb. So I got the script file as follows.</p>
<div id="attachment_10644" style="width: 660px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL12-e1442572352404.png"><img decoding="async" aria-describedby="caption-attachment-10644" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL12-e1442572352404.png" alt="Back Up And Restore Your Old MySQL Database to New Database" width="650" height="457" class="size-full wp-image-10644" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL12-e1442572352404.png 650w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL12-e1442572352404-300x211.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL12-e1442572352404-400x281.png 400w" sizes="(max-width: 650px) 100vw, 650px" /></a><p id="caption-attachment-10644" class="wp-caption-text">Back Up And Restore Your Old MySQL Database to New Database</p></div>
<p>The next thing we need to do is, restoring the back up to our new database right? Hope you already got back up file. </p>
<p>Go to the command prompt again. Type the command as follows.</p>
<div id="attachment_10645" style="width: 684px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL13.png"><img decoding="async" aria-describedby="caption-attachment-10645" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL13.png" alt="Back Up And Restore Your Old MySQL Database to New Database" width="674" height="33" class="size-full wp-image-10645" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL13.png 674w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL13-300x15.png 300w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL13-660x33.png 660w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL13-400x20.png 400w" sizes="(max-width: 674px) 100vw, 674px" /></a><p id="caption-attachment-10645" class="wp-caption-text">Back Up And Restore Your Old MySQL Database to New Database</p></div>
<p>Please be noted that you need to give your new username you have created for your new MySQL database and the new database name here. </p>
<p>In my case <em>vmmysqluser </em>was the username and <em>sibeeshpassion </em>is the database name.</p>
<p>Now it is time to check the database is restored or not. We have some set of queries for that.</p>
<p>First of all change the database to your new database.</p>
<p>[sql]<br />
use yournewdatabasename;<br />
[/sql]</p>
<p>When you run the above query, you will get a message saying database changed. </p>
<p>Now we will see the tables inside this new database.</p>
<p>[sql]<br />
show tables;<br />
[/sql]</p>
<p>It will result the list of tables inside this new database.</p>
<div id="attachment_10646" style="width: 597px" class="wp-caption alignnone"><a href="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL14.png"><img decoding="async" aria-describedby="caption-attachment-10646" src="http://sibeeshpassion.com/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL14.png" alt="Back Up And Restore Your Old MySQL Database to New Database" width="587" height="629" class="size-full wp-image-10646" srcset="/wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL14.png 587w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL14-280x300.png 280w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL14-400x429.png 400w, /wp-content/uploads/2015/09/Back_Up_your_ClearDB_and_restore_in_Azure_Virtual_Machine_MySQL14-560x600.png 560w" sizes="(max-width: 587px) 100vw, 587px" /></a><p id="caption-attachment-10646" class="wp-caption-text">Back Up And Restore Your Old MySQL Database to New Database</p></div>
<p>So we have successfully done back up and restoring our MySQL database in azure virtual machine. </p>
<h3>Conclusion</h3>
<p>Did I miss anything that you may think which is needed?.Have you ever tried virtual machine in azure?. If not, I strongly recommend that. Is this post helped you do back and restore your old database to new one? I hope you liked this article. Please share me your valuable suggestions and feedback.</p>
<h3>Your turn. What do you think?</h3>
<p>A blog isn’t a blog without comments, but do try to stay on topic. If you have a question unrelated to this post, you’re better off posting it on C# Corner, Code Project, Stack Overflow, Asp.Net Forum instead of commenting here. Tweet or email me a link to your question there and I’ll definitely try to help if I am able to.</p>
<p>Kindest Regards<br />
Sibeesh Venu</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/back-up-your-cleardb-and-restore-in-azure-virtual-machine-mysql/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Filters in MDX Queries</title>
		<link>https://mail.sibeeshpassion.com/filters-in-mdx-queries/</link>
					<comments>https://mail.sibeeshpassion.com/filters-in-mdx-queries/#disqus_thread</comments>
		
		<dc:creator><![CDATA[SibeeshVenu]]></dc:creator>
		<pubDate>Mon, 06 Jul 2015 10:11:21 +0000</pubDate>
				<category><![CDATA[MDX Query]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[DBA]]></category>
		<category><![CDATA[Filter Conditions in MDX]]></category>
		<category><![CDATA[Filtering in MDX]]></category>
		<category><![CDATA[Free source code]]></category>
		<category><![CDATA[Intermediate]]></category>
		<category><![CDATA[MDX]]></category>
		<category><![CDATA[MDX Filter]]></category>
		<category><![CDATA[ms-sql-server]]></category>
		<category><![CDATA[OLAP]]></category>
		<category><![CDATA[SQL-server-2005]]></category>
		<category><![CDATA[SQL-Server-2008]]></category>
		<guid isPermaLink="false">http://sibeecst_passion.com/?p=6321</guid>

					<description><![CDATA[Introduction Today we will learn about filter conditions in MDX queries. There are so many conditions in MDX as we have SQL. I am going to discuss most used filter conditions in MDX. I hope you will like it. Background For the past few days I am working on the MDX queries. Since my applications data source were ADOMD data source, It was must to learn about MDX queries. If you are new to ADOMD, you can find out some tips here: ADOMD Tips What is MDX? Before going to start, we will see what MDX is? MDX stands for [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><span style="color: #ff6600;"><strong>Introduction</strong></span></p>
<p>Today we will learn about filter conditions in MDX queries. There are so many conditions in MDX as we have SQL. I am going to discuss most used filter conditions in MDX. I hope you will like it.</p>
<p><span style="color: #ff6600;"><strong>Background</strong></span></p>
<p>For the past few days I am working on the MDX queries. Since my applications data source were ADOMD data source, It was must to learn about MDX queries. If you are new to ADOMD, you can find out some tips here: <a href="http://sibeeshpassion.com/category/microsoft-adomd/" target="_blank">ADOMD Tips</a></p>
<p><span style="color: #ff6600;"><strong>What is MDX?</strong></span></p>
<p>Before going to start, we will see what MDX is?</p>
<li>MDX stands for Multidimensional Expression</li>
<li>It is a query language for OLAP databases like SQL for relational databases</li>
<li> It is also a calculation language</li>
<li>Its syntax is similar to spreadsheet formulas</li>
<p>If you are completely new to MDX, you can read basics <a href="http://www.codeproject.com/Articles/710387/Learn-to-Write-Custom-MDX-Query-First-Time" target="_blank">here</a></p>
<p><span style="color: #ff6600;"><strong>Expressions and Equivalent in MDX</strong></span></p>
<p><img decoding="async" src="http://sibeeshpassion.com/content/images/MDXFilterExpression1.png" alt="" /></p>
<p>Now we will use this conditions in the MDX queries.I hope you are aware of MDX query basics now.</p>
<p><span style="color: #ff6600;"><strong>MDX Filter Expression Examples</strong></span></p>
<p><strong>To Check whether dimension value is empty </strong><br />
To check whether a dimension value is empty or not, you need to add a filter condition as follows.<br />
[sql]<br />
{FILTER([My Dimension Group].[Dimension Name].[Dimension Name], Trim([My Dimension Group].[Dimension Name].CurrentMember.Name) = &#8221;)}<br />
[/sql]</p>
<p><strong>To Check whether dimension value is Not Empty </strong><br />
To check whether a dimension value is not empty or not, you need to add a filter condition as follows.<br />
[sql]<br />
{FILTER([My Dimension Group].[Dimension Name].[Dimension Name], Trim([My Dimension Group].[Dimension Name].CurrentMember.Name) &lt;&gt; &#8221;)}<br />
[/sql]</p>
<p><strong>To Check whether dimension value Contains a particular value </strong><br />
To check whether a dimension value Contains a particular value, you need to add a filter condition as follows.<br />
[sql]<br />
{FILTER([My Dimension Group].[Dimension Name].[Dimension Name], Instr([My Dimension Group].[Dimension Name].CurrentMember.Name, &#8216;My String Value&#8217;) &gt; 0)}<br />
[/sql]</p>
<p><strong>To Check whether dimension value Does Not Contains a particular value </strong><br />
To check whether a dimension value Does Not Contains a particular value, you need to add a filter condition as follows.<br />
[sql]<br />
-{FILTER([My Dimension Group].[Dimension Name].[Dimension Name], Instr([My Dimension Group].[Dimension Name].CurrentMember.Name, &#8216;My String Value&#8217;) &gt; 0)}<br />
[/sql]</p>
<p><strong>To Check whether dimension value Starts With a particular value </strong><br />
To check whether a dimension value Starts With  a particular value, you need to add a filter condition as follows.<br />
[sql]<br />
{FILTER([My Dimension Group].[Dimension Name].[Dimension Name], Left([My Dimension Group].[Dimension Name].CurrentMember.Name, 5) = &#8216;My String Value&#8217;)}<br />
[/sql]</p>
<p><strong>To Check whether dimension value Ends With a particular value </strong><br />
To check whether a dimension value Ends With  a particular value, you need to add a filter condition as follows.<br />
[sql]<br />
{FILTER([My Dimension Group].[Dimension Name].[Dimension Name], Right([My Dimension Group].[Dimension Name].CurrentMember.Name, 5) = &#8216;My String Value&#8217;)}<br />
[/sql]</p>
<p><strong>To Check whether dimension value Equal a particular value </strong><br />
To check whether a dimension value Equal  a particular value, you need to add a filter condition as follows.<br />
[sql]<br />
{FILTER([My Dimension Group].[Dimension Name].[Dimension Name], [My Dimension Group].[Dimension Name].CurrentMember.Name = &#8216;My String Value Carolina&#8217;)}<br />
[/sql]</p>
<p><strong>To Check whether dimension value is NULL </strong><br />
To check whether a dimension value is NULL, you need to add a filter condition as follows.<br />
[sql]<br />
{FILTER([My Dimension Group].[Dimension Name].[Dimension Name], [Measures].[Mesure Name] = NULL)}<br />
[/sql]</p>
<p><strong>To Check whether dimension value is NOT NULL </strong><br />
To check whether a dimension value is NOT NULL, you need to add a filter condition as follows.<br />
[sql]<br />
NON EMPTY([My Dimension Group].[Dimension Name].[Dimension Name])<br />
[/sql]</p>
<p>Following are the examples of queries which uses above mentioned expressions.</p>
<p><strong>Query 1</strong><br />
[sql]</p>
<p>SELECT {[Measures].[Mesure Name]} ON COLUMNS,<br />
({FILTER([My Dimension Group].[Dimension Name].[Dimension Name], Trim([My Dimension Group].[Dimension Name].CurrentMember.Name) = &#8221;)}) ON ROWS<br />
FROM [My Cube Name]</p>
<p>[/sql]</p>
<p><strong>Query 2</strong><br />
[sql]<br />
SELECT {[Measures].[Mesure Name]} ON COLUMNS,<br />
({FILTER([My Dimension Group].[Dimension Name].[Dimension Name], Instr([My Dimension Group].[Dimension Name].CurrentMember.Name, &#8216;My String Value&#8217;) &gt; 0)}) ON ROWS<br />
FROM [My Cube Name]<br />
[/sql]</p>
<p><strong>Query 3</strong><br />
[sql]<br />
SELECT {[Measures].[Mesure Name]} ON COLUMNS,<br />
({FILTER([My Dimension Group].[Dimension Name].[Dimension Name], Left([My Dimension Group].[Dimension Name].CurrentMember.Name, 5) = &#8216;My String Value&#8217;)}) ON ROWS<br />
FROM [My Cube Name]<br />
[/sql]</p>
<p><strong>Query 4</strong><br />
[sql]<br />
SELECT {[Measures].[Mesure Name]} ON COLUMNS,<br />
({FILTER([My Dimension Group].[Dimension Name].[Dimension Name], Right([My Dimension Group].[Dimension Name].CurrentMember.Name, 5) = &#8216;My String Value&#8217;)}) ON ROWS<br />
FROM [My Cube Name]<br />
[/sql]</p>
<p><strong>Query 5</strong><br />
[sql]<br />
SELECT {[Measures].[Mesure Name]} ON COLUMNS,<br />
({FILTER([My Dimension Group].[Dimension Name].[Dimension Name], [My Dimension Group].[Dimension Name].CurrentMember.Name = &#8216;My String Value Carolina&#8217;)}) ON ROWS<br />
FROM [My Cube Name]<br />
[/sql]</p>
<p><strong>Query 6</strong><br />
[sql]<br />
SELECT {[Measures].[Mesure Name]} ON COLUMNS,<br />
({FILTER([My Dimension Group].[Dimension Name].[Dimension Name], [Measures].[Mesure Name] = NULL)}) ON ROWS<br />
FROM [My Cube Name]<br />
[/sql]</p>
<p><strong>Query 7</strong><br />
[sql]<br />
SELECT {[Measures].[Mesure Name]} ON COLUMNS,<br />
NON EMPTY([My Dimension Group].[Dimension Name].[Dimension Name]) ON ROWS<br />
FROM [My Cube Name]<br />
[/sql]</p>
<p>That is for now 🙂</p>
<p><span style="color: #ff6600;"><strong>Conclusion</strong></span></p>
<p>I hope someone found this article useful. Please share me your valuable thoughts and comments. Your feedback is always welcomed.</p>
<p>Thanks in advance. Happy coding!</p>
<p>Kindest Regards<br />
<a href="https://plus.google.com/+sibeeshkv" target="_blank">Sibeesh Venu</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://mail.sibeeshpassion.com/filters-in-mdx-queries/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
