<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[مشکل در اتصال به mysql]]></title><description><![CDATA[<p dir="auto">p{direction:rtl; text-align:right}. سلام. من دارم اتصال از C++ به database رو یاد می‌گیرم. برای اولین بار توی Qt این کدهای زیر رو زدم:</p>
<p dir="auto">@QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");<br />
db.setHostName("localhost");<br />
db.setDatabaseName("dvd_collection");<br />
db.setUserName("root");<br />
db.setPassword("******");<br />
if (!db.open())<br />
{<br />
QDebug &lt;&lt; db.lastError();<br />
qFatal("err");<br />
}@</p>
<p dir="auto">p{direction:rtl; text-align:right}. اینا رو هم توی سازنده‌ی mainwindow نوشتم. وقتی run می‌زنم که کامپایل بشه ارور زیر میاد:</p>
<p dir="auto">/usr/include/QtSql/qsql_mysql.h:52: error: mysql.h: No such file or directory</p>
<p dir="auto">p{direction:rtl; text-align:right}. وقتی روش دابل کلیک می‌کنم منو می‌بره توی فایل qsql_mysql.h و به خط ۵۲ش گیر می‌ده که اون خط هست:<br />
@#include &lt;mysql.h&gt;@</p>
<p dir="auto">p{direction:rtl; text-align:right}. خیلی ور رفتم باهاش مشکلش حل نشده. من توی فدورا ۱۸ ۶۴ بیت کد می‌زنم. بسته‌های qt-mysql و mysql-devel رو هم نصب کردم. با تشکر.</p>
]]></description><link>https://forum.qt.io/topic/25062/مشکل-در-اتصال-به-mysql</link><generator>RSS for Node</generator><lastBuildDate>Fri, 19 Jun 2026 12:59:55 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/25062.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 10 Mar 2013 03:15:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to مشکل در اتصال به mysql on Sun, 10 Mar 2013 10:07:54 GMT]]></title><description><![CDATA[<p dir="auto">p{direction:rtl;text-align:right;}. به نظر میرسه که مشکل مربوط به لایبرری QSQL باشه. چون شما داری از یک روش داینامیک برای ارتباط با بانک استفاده میکنی بنابراین نباید جلوی کامپایل شدن رو بگیره.</p>
<p dir="auto">p{direction:rtl;text-align:right;}. احتمالا mysql داخل QSQL بصورت static کانفیگ شده و مسیر header های libmysql رو نمیتونه پیدا کنه.</p>
<p dir="auto">"QtExperts":<a href="http://www.qte.ir/?ref=846b1bbae48092b640bacd682d305f02" target="_blank" rel="noopener noreferrer nofollow ugc">http://www.qte.ir/?ref=846b1bbae48092b640bacd682d305f02</a></p>
]]></description><link>https://forum.qt.io/post/169714</link><guid isPermaLink="true">https://forum.qt.io/post/169714</guid><dc:creator><![CDATA[mohsen]]></dc:creator><pubDate>Sun, 10 Mar 2013 10:07:54 GMT</pubDate></item></channel></rss>