<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: How To: Use MySQL Connector/C++ to Connect to a MySQL Database in Windows</title>
	<atom:link href="http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows</link>
	<description>A number-pimping side project from the valleys in *NEW* upside-down flavour.</description>
	<lastBuildDate>Tue, 15 May 2012 23:01:55 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/#comment-7352</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Fri, 16 Dec 2011 00:33:11 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3677#comment-7352</guid>
		<description>I don&#039;t know what you mean by &quot;no input file from the compiler&quot; - what error message do you get? (please quote the entire, exact error message)</description>
		<content:encoded><![CDATA[<p>I don&#8217;t know what you mean by &#8220;no input file from the compiler&#8221; &#8211; what error message do you get? (please quote the entire, exact error message)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sathishkumar</title>
		<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/#comment-7350</link>
		<dc:creator>sathishkumar</dc:creator>
		<pubDate>Thu, 15 Dec 2011 13:56:57 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3677#comment-7350</guid>
		<description>Hi r3dux,

i tried to connect mysql db using c++. but, compile time i get no input file from compiler.how to solve this problem?</description>
		<content:encoded><![CDATA[<p>Hi r3dux,</p>
<p>i tried to connect mysql db using c++. but, compile time i get no input file from compiler.how to solve this problem?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/#comment-7102</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Thu, 03 Nov 2011 06:09:59 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3677#comment-7102</guid>
		<description>I originally wrote this code using XP and Visual Studio 2008 and it worked correctly when built in Release mode - if you&#039;re going to use this with Windows 7 and/or Visual Studio I&#039;d recommend creating a new project entirely and copying and pasting the code in then setting up the libraries of the VS project, as something&#039;s obviously going wrong with the conversion.

I recently had to cover this material in a class I&#039;m teaching (like, last week) and it worked fine with Windows 7 and Visual Studio 2008 - so it must be a VS2010 thing.

This might help you out (but remember to get rid of the password if you&#039;re using WAMP Server as by default there is no password for the root account): &lt;a href=&quot;http://blog.ulf-wendel.de/?p=215#hello&quot; rel=&quot;nofollow&quot;&gt;http://blog.ulf-wendel.de/?p=215#hello&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>I originally wrote this code using XP and Visual Studio 2008 and it worked correctly when built in Release mode &#8211; if you&#8217;re going to use this with Windows 7 and/or Visual Studio I&#8217;d recommend creating a new project entirely and copying and pasting the code in then setting up the libraries of the VS project, as something&#8217;s obviously going wrong with the conversion.</p>
<p>I recently had to cover this material in a class I&#8217;m teaching (like, last week) and it worked fine with Windows 7 and Visual Studio 2008 &#8211; so it must be a VS2010 thing.</p>
<p>This might help you out (but remember to get rid of the password if you&#8217;re using WAMP Server as by default there is no password for the root account): <a href="http://blog.ulf-wendel.de/?p=215#hello">http://blog.ulf-wendel.de/?p=215#hello</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rr.</title>
		<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/#comment-7096</link>
		<dc:creator>rr.</dc:creator>
		<pubDate>Wed, 02 Nov 2011 14:34:28 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3677#comment-7096</guid>
		<description>If I try to run it again in DEBUG mode after I replace the files (to run it in RELEASE mode and it works),

then it spit out message like “Could not connect to database. Error message: Access denied for user &#039;ODBC&#039;@&#039;localhost&#039; (using password: NO)”

I don&#039;t know what is wrong with me.

Any advice will be appreciated.

Thanks.</description>
		<content:encoded><![CDATA[<p>If I try to run it again in DEBUG mode after I replace the files (to run it in RELEASE mode and it works),</p>
<p>then it spit out message like “Could not connect to database. Error message: Access denied for user &#8216;ODBC&#8217;@'localhost&#8217; (using password: NO)”</p>
<p>I don&#8217;t know what is wrong with me.</p>
<p>Any advice will be appreciated.</p>
<p>Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: rr.</title>
		<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/#comment-7095</link>
		<dc:creator>rr.</dc:creator>
		<pubDate>Wed, 02 Nov 2011 14:28:02 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3677#comment-7095</guid>
		<description>It’s a bit strange for me.
In my case, it only works with DEBUG mode.
In RELEASE mode, it spit out message like “Could not connect to database. Error message: Unknown exception”.

I tested with: Windows 7 SP1 Pro x64 + MySQL x64 5.5.12 + VS 2010 SP1
(I converted the original project into VS 2011 project)

To run it in RELEASE model, I had to replace “mysqlcppconn.dll” and “mysqlcppconn.lib”.
(I extracted the files from “mysql-connector-c++-noinstall-1.1.0-win32.zip” at http://www.mologie.de/blog/2010/10/mysql-connector-c-und-visual-studio-2010/)

Did I do something wrong?
</description>
		<content:encoded><![CDATA[<p>It’s a bit strange for me.<br />
In my case, it only works with DEBUG mode.<br />
In RELEASE mode, it spit out message like “Could not connect to database. Error message: Unknown exception”.</p>
<p>I tested with: Windows 7 SP1 Pro x64 + MySQL x64 5.5.12 + VS 2010 SP1<br />
(I converted the original project into VS 2011 project)</p>
<p>To run it in RELEASE model, I had to replace “mysqlcppconn.dll” and “mysqlcppconn.lib”.<br />
(I extracted the files from “mysql-connector-c++-noinstall-1.1.0-win32.zip” at <a href="http://www.mologie.de/blog/2010/10/mysql-connector-c-und-visual-studio-2010/">http://www.mologie.de/blog/2010/10/mysql-connector-c-und-visual-studio-2010/</a>)</p>
<p>Did I do something wrong?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: james</title>
		<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/#comment-7022</link>
		<dc:creator>james</dc:creator>
		<pubDate>Wed, 12 Oct 2011 13:48:01 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3677#comment-7022</guid>
		<description>I think you&#039;re right about needing to recompile Connector/C++ under VS 2010.

Was able to obtain VS 2008 Express and it works fine now.
Thanks for the help &amp; the great sample code!</description>
		<content:encoded><![CDATA[<p>I think you&#8217;re right about needing to recompile Connector/C++ under VS 2010.</p>
<p>Was able to obtain VS 2008 Express and it works fine now.<br />
Thanks for the help &amp; the great sample code!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/#comment-7021</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Tue, 11 Oct 2011 21:59:32 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3677#comment-7021</guid>
		<description>Hi James,

It sounds like you&#039;re doing everything right - service is running, can see &amp; connect to database from MySQL tools etc....

If you&#039;re getting an unknown exception error (which I think is the error you&#039;re referring to) then I&#039;d have to guess that it&#039;s got to be some kind of library mismatch - try getting a new version of Connector/C++ for Visual Studio 2010 and substitute in those dlls for any in the existing project. Also, the libs I provided with the precompiled project are 32-bit, if your system is 64-bit it&#039;s not going to work.

Also if you separate out each line of &quot;risky&quot; code into its own separate try/catch block then you&#039;ll know exactly which statement is failing, like this:

&lt;pre lang=&quot;cpp&quot;&gt;
try
{
	cout &lt;&lt; &quot;About to try to USE mysql...&quot; &lt;&lt; endl;
	stmt-&gt;execute(&quot;USE mysql&quot;);
	cout &lt;&lt; &quot;USEd mysql without dying!&quot; &lt;&lt; endl;
}
catch (sql::SQLException e)
{
	cout &lt;&lt; &quot;SQLException on USE: &quot; &lt;&lt; e.what() &lt;&lt;endl;
	exit(-1);
}
catch (exception e)
{
	cout &lt;&lt; &quot;Generic exception on USE: &quot; &lt;&lt; e.what() &lt;&lt; endl;
	exit(-1);
}

try
{
	cout &lt;&lt; &quot;About to try to show tables...&quot; &lt;&lt; endl;
	res = stmt-&gt;executeQuery(&quot;show tables&quot;); 
	cout &lt;&lt; &quot;Showed tables without dying!&quot; &lt;&lt; endl;
}
catch (sql::SQLException e)
{
	cout &lt;&lt; &quot;SQLException on show tables: &quot; &lt;&lt; e.what() &lt;&lt;endl;
	exit(-1);
}
catch (exception e)
{
	cout &lt;&lt; &quot;Generic exception on show tables: &quot; &lt;&lt; e.what() &lt;&lt; endl;
	exit(-1);
}&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Hi James,</p>
<p>It sounds like you&#8217;re doing everything right &#8211; service is running, can see &amp; connect to database from MySQL tools etc&#8230;.</p>
<p>If you&#8217;re getting an unknown exception error (which I think is the error you&#8217;re referring to) then I&#8217;d have to guess that it&#8217;s got to be some kind of library mismatch &#8211; try getting a new version of Connector/C++ for Visual Studio 2010 and substitute in those dlls for any in the existing project. Also, the libs I provided with the precompiled project are 32-bit, if your system is 64-bit it&#8217;s not going to work.</p>
<p>Also if you separate out each line of &#8220;risky&#8221; code into its own separate try/catch block then you&#8217;ll know exactly which statement is failing, like this:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #0000ff;">try</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;About to try to USE mysql...&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
	stmt<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>execute<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;USE mysql&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;USEd mysql without dying!&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #0000ff;">catch</span> <span style="color: #008000;">&#40;</span>sql<span style="color: #008080;">::</span><span style="color: #007788;">SQLException</span> e<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;SQLException on USE: &quot;</span> <span style="color: #000080;">&lt;&lt;</span> e.<span style="color: #007788;">what</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span>endl<span style="color: #008080;">;</span>
	<span style="color: #0000dd;">exit</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #0000ff;">catch</span> <span style="color: #008000;">&#40;</span>exception e<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Generic exception on USE: &quot;</span> <span style="color: #000080;">&lt;&lt;</span> e.<span style="color: #007788;">what</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
	<span style="color: #0000dd;">exit</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
&nbsp;
<span style="color: #0000ff;">try</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;About to try to show tables...&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
	res <span style="color: #000080;">=</span> stmt<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>executeQuery<span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;show tables&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span> 
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Showed tables without dying!&quot;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #0000ff;">catch</span> <span style="color: #008000;">&#40;</span>sql<span style="color: #008080;">::</span><span style="color: #007788;">SQLException</span> e<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;SQLException on show tables: &quot;</span> <span style="color: #000080;">&lt;&lt;</span> e.<span style="color: #007788;">what</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span>endl<span style="color: #008080;">;</span>
	<span style="color: #0000dd;">exit</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #0000ff;">catch</span> <span style="color: #008000;">&#40;</span>exception e<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Generic exception on show tables: &quot;</span> <span style="color: #000080;">&lt;&lt;</span> e.<span style="color: #007788;">what</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
	<span style="color: #0000dd;">exit</span><span style="color: #008000;">&#40;</span><span style="color: #000040;">-</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: james</title>
		<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/#comment-7020</link>
		<dc:creator>james</dc:creator>
		<pubDate>Tue, 11 Oct 2011 17:46:33 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3677#comment-7020</guid>
		<description>I&#039;m getting the same error as Chloe. Did you find out what was causing her problem?

I followed your suggestions to her:
 - Confirm the mysql service is running from the WAMP indicator in the bottom-right system tray,
 - Confirm (via phpmyadmin) that a database called “mysql” exists.
 - Can log in using &quot;msql.exe -u root&quot;, &amp; issue &quot;use mysql&quot; &amp; &quot;show tables&quot;
 - Turned firewall off

I put some debug messages and it looks like the error happens when doing:
stmt-&gt;execute(&quot;USE mysql&quot;);

Everything compiled ok under MS VC++ 2010 Express (Release build).
I was going to try w/ 2008, but having trouble downloading it at the moment.
Would appreciate any help. 
Thanks.</description>
		<content:encoded><![CDATA[<p>I&#8217;m getting the same error as Chloe. Did you find out what was causing her problem?</p>
<p>I followed your suggestions to her:<br />
 &#8211; Confirm the mysql service is running from the WAMP indicator in the bottom-right system tray,<br />
 &#8211; Confirm (via phpmyadmin) that a database called “mysql” exists.<br />
 &#8211; Can log in using &#8220;msql.exe -u root&#8221;, &amp; issue &#8220;use mysql&#8221; &amp; &#8220;show tables&#8221;<br />
 &#8211; Turned firewall off</p>
<p>I put some debug messages and it looks like the error happens when doing:<br />
stmt-&gt;execute(&#8220;USE mysql&#8221;);</p>
<p>Everything compiled ok under MS VC++ 2010 Express (Release build).<br />
I was going to try w/ 2008, but having trouble downloading it at the moment.<br />
Would appreciate any help.<br />
Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: r3dux</title>
		<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/#comment-6790</link>
		<dc:creator>r3dux</dc:creator>
		<pubDate>Fri, 03 Jun 2011 06:26:17 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3677#comment-6790</guid>
		<description>Um, maybe. You &lt;strong&gt;cannot&lt;/strong&gt; build the provided project in Debug mode, you have to build it in &lt;strong&gt;Release&lt;/strong&gt; mode, because there are no debug symbols in the provided libraries, as mentioned in the article. If you want to build it in debug mode, you need to obtain and link to debug versions of the the libraries (libmysql, Connector/C++ etc).

If you &lt;em&gt;are&lt;/em&gt; building in Release mode and it&#039;s still not working, then I&#039;m not so sure. The connect to server catch block is triggering, i.e. this bit:

&lt;pre lang=&quot;cpp&quot;&gt;
// Try to connect to the DBMS server
try
{
	dbConn = driver-&gt;connect(server, username, password);
}
catch (sql::SQLException e)
{
	cout &lt;&lt; &quot;Could not connect to database. Error message: &quot; &lt;&lt; e.what() &lt;&lt; endl;
	system(&quot;pause&quot;);
	exit(1);
}
&lt;/pre&gt;

But, I&#039;ve just tested the code with Visual Studio 2008 and I get:

&lt;em&gt;Could not connect to database. Error message: Can&#039;t connect to MySQL server on &#039;127.0.0.1&#039; (10061)&lt;/em&gt; - if the MySQL server isn&#039;t running or is pointed at an bad address,
&lt;em&gt;SQL error. Error message: Access denied for user &#039;&#039;@&#039;localhost&#039; to database &#039;mysql&#039;&lt;/em&gt; - if MySQL is running and we connect to it, but provide an invalid username, and
&lt;em&gt;Could not connect to database. Error message: Access denied for user &#039;root&#039;@&#039;localhost&#039; (using password: YES)&lt;/em&gt; - if MySQL is running and we connect but provide an invalid password.

Again, I think it&#039;ll be a library thing and either an incompatibility with VS2010 (in which case perhaps you&#039;ll need to get libraries compiled for VS2010), or you&#039;re trying to run 32-bit libs on a 64-bit OS and it&#039;s not liking it.

Best of luck &amp; hope you get it sorted,
r3dux</description>
		<content:encoded><![CDATA[<p>Um, maybe. You <strong>cannot</strong> build the provided project in Debug mode, you have to build it in <strong>Release</strong> mode, because there are no debug symbols in the provided libraries, as mentioned in the article. If you want to build it in debug mode, you need to obtain and link to debug versions of the the libraries (libmysql, Connector/C++ etc).</p>
<p>If you <em>are</em> building in Release mode and it&#8217;s still not working, then I&#8217;m not so sure. The connect to server catch block is triggering, i.e. this bit:</p>

<div class="wp_syntax"><div class="code"><pre class="cpp" style="font-family:monospace;"><span style="color: #666666;">// Try to connect to the DBMS server</span>
<span style="color: #0000ff;">try</span>
<span style="color: #008000;">&#123;</span>
	dbConn <span style="color: #000080;">=</span> driver<span style="color: #000040;">-</span><span style="color: #000080;">&gt;</span>connect<span style="color: #008000;">&#40;</span>server, username, password<span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span>
<span style="color: #0000ff;">catch</span> <span style="color: #008000;">&#40;</span>sql<span style="color: #008080;">::</span><span style="color: #007788;">SQLException</span> e<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	<span style="color: #0000dd;">cout</span> <span style="color: #000080;">&lt;&lt;</span> <span style="color: #FF0000;">&quot;Could not connect to database. Error message: &quot;</span> <span style="color: #000080;">&lt;&lt;</span> e.<span style="color: #007788;">what</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #000080;">&lt;&lt;</span> endl<span style="color: #008080;">;</span>
	<span style="color: #0000dd;">system</span><span style="color: #008000;">&#40;</span><span style="color: #FF0000;">&quot;pause&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
	<span style="color: #0000dd;">exit</span><span style="color: #008000;">&#40;</span><span style="color: #0000dd;">1</span><span style="color: #008000;">&#41;</span><span style="color: #008080;">;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>But, I&#8217;ve just tested the code with Visual Studio 2008 and I get:</p>
<p><em>Could not connect to database. Error message: Can&#8217;t connect to MySQL server on &#8217;127.0.0.1&#8242; (10061)</em> &#8211; if the MySQL server isn&#8217;t running or is pointed at an bad address,<br />
<em>SQL error. Error message: Access denied for user &#8221;@&#8217;localhost&#8217; to database &#8216;mysql&#8217;</em> &#8211; if MySQL is running and we connect to it, but provide an invalid username, and<br />
<em>Could not connect to database. Error message: Access denied for user &#8216;root&#8217;@'localhost&#8217; (using password: YES)</em> &#8211; if MySQL is running and we connect but provide an invalid password.</p>
<p>Again, I think it&#8217;ll be a library thing and either an incompatibility with VS2010 (in which case perhaps you&#8217;ll need to get libraries compiled for VS2010), or you&#8217;re trying to run 32-bit libs on a 64-bit OS and it&#8217;s not liking it.</p>
<p>Best of luck &amp; hope you get it sorted,<br />
r3dux</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan</title>
		<link>http://r3dux.org/2010/11/how-to-use-mysql-connectorc-to-connect-to-a-mysql-database-in-windows/#comment-6788</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Fri, 03 Jun 2011 04:29:36 +0000</pubDate>
		<guid isPermaLink="false">http://r3dux.org/?p=3677#comment-6788</guid>
		<description>Hi, Im currently having some probs with mysql. im using vs2010 and wamp, yet i have problem whenever i debug: 
Could not connect to database. Error message: Unknown exception.

Do you know the solution to it? 
:)</description>
		<content:encoded><![CDATA[<p>Hi, Im currently having some probs with mysql. im using vs2010 and wamp, yet i have problem whenever i debug:<br />
Could not connect to database. Error message: Unknown exception.</p>
<p>Do you know the solution to it?<br />
 <img src='http://r3dux.org/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
</channel>
</rss>

