<?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>How to connect mysql database using python? Archives -</title>
	<atom:link href="https://mitindia.in/tag/how-to-connect-mysql-database-using-python/feed/" rel="self" type="application/rss+xml" />
	<link>https://mitindia.in/tag/how-to-connect-mysql-database-using-python/</link>
	<description></description>
	<lastBuildDate>Mon, 03 Dec 2018 10:22:01 +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>https://mitindia.in/wp-content/uploads/2023/03/cropped-android-chrome-512x512-1-32x32.png</url>
	<title>How to connect mysql database using python? Archives -</title>
	<link>https://mitindia.in/tag/how-to-connect-mysql-database-using-python/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>How to run python programs on wamp server</title>
		<link>https://mitindia.in/how-to-run-python-programs-on-wamp-server/</link>
					<comments>https://mitindia.in/how-to-run-python-programs-on-wamp-server/#comments</comments>
		
		<dc:creator><![CDATA[SKB]]></dc:creator>
		<pubDate>Sat, 23 Jun 2018 12:32:24 +0000</pubDate>
				<category><![CDATA[Artificial Intelligence]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[How to connect mysql database using python?]]></category>
		<category><![CDATA[how to run python?]]></category>
		<guid isPermaLink="false">http://www.mitindia.in/?p=901</guid>

					<description><![CDATA[<p>How to run python in wamp server and mysql connectivity using python program Steps: Create a simple python program file as following. #!C:/Python27/python.exe print &#8220;Content-type: text/html\n&#8221; print &#8220;&#60;h1 align=center&#62;Python programming&#60;/h1&#62;&#8221; print &#8220;&#60;hr&#62;&#8221; print &#8220;&#60;h2&#62;Hello, world!&#60;/h2&#62;&#8221; 2. Save above file as &#8220;test.py &#8221; in wamp -&#62;www directory 3. Start wamp server 4. Open browser and type [&#8230;]</p>
<p>The post <a href="https://mitindia.in/how-to-run-python-programs-on-wamp-server/">How to run python programs on wamp server</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></description>
										<content:encoded><![CDATA[<h1>How to run python in wamp server and mysql connectivity using python program</h1>
<p><strong>Steps:</strong></p>
<ol>
<li><strong>Create a simple python program file as following.</strong></li>
</ol>
<div>#!C:/Python27/python.exe</div>
<div>print &#8220;Content-type: text/html\n&#8221;</div>
<div>print &#8220;&lt;h1 align=center&gt;Python programming&lt;/h1&gt;&#8221;</div>
<div>print &#8220;&lt;hr&gt;&#8221;</div>
<div>print &#8220;&lt;h2&gt;Hello, world!&lt;/h2&gt;&#8221;</div>
<div></div>
<div>2. Save above file as &#8220;test.py &#8221; in wamp -&gt;www directory</div>
<div>3. Start wamp server</div>
<div>4. Open browser and type page url [as the following screen shot]</div>
<div><img fetchpriority="high" decoding="async" class="alignnone size-full wp-image-902" src="http://www.mitindia.in/wp-content/uploads/2018/06/hello-world.jpg" alt="" width="781" height="251" srcset="https://mitindia.in/wp-content/uploads/2018/06/hello-world.jpg 781w, https://mitindia.in/wp-content/uploads/2018/06/hello-world-300x96.jpg 300w, https://mitindia.in/wp-content/uploads/2018/06/hello-world-768x247.jpg 768w" sizes="(max-width: 781px) 100vw, 781px" /></div>
<div></div>
<h2><span style="color: #ff6600;">How to connect MySQL database using Python?</span></h2>
<ol>
<li><strong>Create a table in </strong>MySQL<strong> with the following record </strong></li>
</ol>
<p><img decoding="async" class="alignnone size-full wp-image-903" src="http://www.mitindia.in/wp-content/uploads/2018/06/table.jpg" alt="" width="547" height="181" srcset="https://mitindia.in/wp-content/uploads/2018/06/table.jpg 547w, https://mitindia.in/wp-content/uploads/2018/06/table-300x99.jpg 300w" sizes="(max-width: 547px) 100vw, 547px" /></p>
<p><strong>2. Now create python program called &#8220;db5.py&#8221; as following</strong></p>
<blockquote><p>#!C:/Python27/python.exe<br />
print &#8220;Content-type: text/html\n&#8221;<br />
# Database program to access mysql data on WAMP server<br />
print(&#8220;&lt;h1&gt; Python and MySQL Connection &lt;/h1&gt;&#8221;)<br />
print(&#8220;&lt;hr&gt;&#8221;)<br />
import pymysql<br />
conn=pymysql.connect(host=&#8217;localhost&#8217;, user=&#8217;root&#8217;,<br />
password=&#8221;, db=&#8217;demo&#8217;)<br />
a=conn.cursor()<br />
sql=&#8217;SELECT * from emp&#8217;;<br />
a.execute(sql)<br />
countrow=a.execute(sql)</p>
<p>data=a.fetchall()<br />
print &#8220;&lt;table border=1 cellpadding=4 cellspacing=4&gt;&#8221;<br />
print &#8220;&lt;tr bgcolor=yellow&gt;&lt;th&gt; Name &lt;/th&gt; &lt;th&gt; Basic<br />
&lt;/th&gt; &lt;th&gt; Bonus &lt;/th&gt; &lt;th&gt; TA &lt;/th&gt; &lt;th&gt; PF &lt;/th&gt;<br />
&lt;/tr&gt;&#8221;<br />
for row in data :<br />
print<br />
&#8220;&lt;tr&gt;&lt;td&gt;&#8221;,row[0],&#8221;&lt;/td&gt;&#8221;,&#8221;&lt;td&gt;&#8221;,row[1],&#8221;&lt;/td&gt;&#8221;,&#8221;&lt;td&gt;&#8221;,<br />
row[2],&#8221;&lt;/td&gt;&#8221;,&#8221;&lt;td&gt;&#8221;,row[3],&#8221;&lt;/td&gt;&#8221;,&#8221;&lt;td&gt;&#8221;,row[4],&#8221;&lt;/td<br />
&gt; &lt;/tr&gt;&#8221;<br />
print &#8220;&lt;/table&gt;&#8221;</p></blockquote>
<p><strong>3. See the output as following</strong></p>
<p><img decoding="async" class="alignnone size-full wp-image-904" src="http://www.mitindia.in/wp-content/uploads/2018/06/records.jpg" alt="" width="610" height="419" srcset="https://mitindia.in/wp-content/uploads/2018/06/records.jpg 610w, https://mitindia.in/wp-content/uploads/2018/06/records-300x206.jpg 300w" sizes="(max-width: 610px) 100vw, 610px" /></p>
<div></div>
<div style="text-align: right;"><a href="http://www.mitindia.in/artificial-intelligence/">Read here Artifical Intelligence</a></div>
<div><span style="color: #ff0000;"><a style="color: #ff0000;" href="http://www.pradhita.in/" target="_blank" rel="noopener">for State and Central Government Jobs and Career, Click here</a> </span></div>
<p><a class="a2a_button_whatsapp" href="https://www.addtoany.com/add_to/whatsapp?linkurl=https%3A%2F%2Fmitindia.in%2Fhow-to-run-python-programs-on-wamp-server%2F&amp;linkname=How%20to%20run%20python%20programs%20on%20wamp%20server" title="WhatsApp" rel="nofollow noopener" target="_blank"></a><a class="a2a_button_facebook" href="https://www.addtoany.com/add_to/facebook?linkurl=https%3A%2F%2Fmitindia.in%2Fhow-to-run-python-programs-on-wamp-server%2F&amp;linkname=How%20to%20run%20python%20programs%20on%20wamp%20server" title="Facebook" 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%2Fmitindia.in%2Fhow-to-run-python-programs-on-wamp-server%2F&#038;title=How%20to%20run%20python%20programs%20on%20wamp%20server" data-a2a-url="https://mitindia.in/how-to-run-python-programs-on-wamp-server/" data-a2a-title="How to run python programs on wamp server"><img src="https://static.addtoany.com/buttons/favicon.png" alt="Share"></a></p><p>The post <a href="https://mitindia.in/how-to-run-python-programs-on-wamp-server/">How to run python programs on wamp server</a> appeared first on <a href="https://mitindia.in"></a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://mitindia.in/how-to-run-python-programs-on-wamp-server/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
