C#Öе÷ÓÃmysql´æ´¢¹ý³Ì³öÏÖµÄÎÊÌâ
ÔÚrootÕ˺ÅÖÐ,¿ÉÒÔÕý³£µ÷Óô洢¹ý³Ì.
»»µ½common_userÕ˺Åʱ,ͬһ´æ´¢¹ý³ÌÃûµ÷ÓóöÏÖÎÊÌâ.
×·×Ùµ÷ÊÔʱ³öÏÖ:
SELECT command denied to user 'common_user'@'localhost' for table 'proc'
ËÑË÷½â¾ö·½°¸:
MySqlConnection myconnection = new MySqlConnection("server=localhost;user id=common_user; password=***;database=testdb; Use Procedure Bodies=false;Charset=utf8;");
¹Ø¼üÓï¾äÊÇ:
Use Procedure Bodies=false;
ÔÚÍøÉÏËÑË÷±¾¾äº¬Òå:
Name : Use Procedure Bodies
Default : true
Description : Setting this option to false indicates that the user connecting to the database does not have the SELECT privileges for the mysql.proc (stored procedures) table. When to set to false, Connector/NET will not rely on this information being available when the procedure is called. Because Connector/NET will be unable to determine this information, you should explicitly set the types of the all the parameters before the call and the parameters should be added to the command in the exact same order as they appear in the procedure definition. This option was added in Connector/NET 5.0.4 and Connector/NET 1.0.10.
´óÌåÒâ˼ÊÇ˵:
µ±ÉèÖÃʱuse procedure bodies=false£¬´æ´¢¹ý³ÌµÄ²ÎÊýÐèÒªÓë³ÌÐòÀïµÄ²ÎÊý˳ÐòÒ»ÖÂ.
»¹Î´½áÊø.
ÔÚmysql¹Ù·½.¸ø³öÁËÕâÑùÉèÖûáÓÐÒ»¸öBUG.
http://bugs.mysql.com/bug.php?id=36694
µ±È»ÕâÑù½â¾öµÄ°ì·¨»¹ÊÇÓеÄ.¿ÉÒÔʹÓÃODBCÁ¬½ÓÀ´ÊµÏÖ.
ÕâÀï²»ÔÙÏêϸ˵Ã÷.
¸½ÉÏ.NETÁ¬½ÓmysqlµÄÁ¬½Ó×Ö·û´®ÍøÖ·(±È½ÏÈ«ÃæµÄÁ¬½Ó¹éÀà):
http://www.connectionstrings.com/mysql
Ïà¹ØÎĵµ£º
¡¡¡¡¡¡ÓÃc#¸øPDA×öÁËÒ»¸öPC¶ËµÄͨѶ³ÌÐò£¬ÐèÒª±£´æÁ½¸ö²ÎÊý¡£ÓÃDelphiʱ£¬ÊDZ£´æÔÚiniÎļþÖУ¬c#¶ÁдXML±È½Ï·½±ã£¬¾ÍÓÃxmlÎļþÀ´±£´æÁË¡£
¡¡¡¡¡¡
¡¡
class CXmlClass
{
private string XmlFilePath;
/// <summary>
/// ÏÂÔص½PDAµÄTXTÎļþ·¾¶¡¡
/// </summary>
......
³ÌÐòÆô¶¯Sql ServerÆäʵºÜ¼òµ¥
´úÂ룺
System.ServiceProcess.ServiceController myController =
new System.ServiceProcess.ServiceController("MSSQL$ACCP4444"); //·þÎñÃû³Æ ÕÒÁË°ëÌì²ÅÕÒµ½£¬±¿ËÀÎÒÍêÁË¡£ÔÚ·þÎñÉÏÓÒ¼üÊôÐÔ£¬ÄÜ¿´µ½
if (myController.CanStop)
{ }
else ......
PBÁ¬½ÓMySQLÊý¾Ý¿â
È¥mysqlµÄ¹Ù·½ÍøÕ¾ÏÂÔØodbc connector(http://dev.mysql.com/downloads/connector/odbc/)
ÏÂÔصÄÊÇmysql-connector-odbc-noinstall-5.1.6-win32.zip
½âѹºóÖ±½ÓÔËÐÐÎļþ¼ÐÖÐµÄ Install.bat Åú´¦ÀíÎļþ
mysql-connectorÓкü¸ÖÖ£¬Ñ¡ÔñÒ»¸ö×Ô¼ºÏ²»¶µÄ¼´¿É¡£
ÔÚxpÖдò¿ªODBCÊý¾ÝÔ´¹ÜÀíÆ÷£¨¿ØÖ ......
Êý¾Ýͬ²½ÎÊÌâÖÕÓÚ½â¾ö£º
תÌû£ºA·þÎñÆ÷£º host 192.168.1.101 port 3306 B·þÎñÆ÷£º host 192.168.1.102 port 3306 1,ÊÚȨÓû§£º A·þÎñÆ÷ mysql>grant replication slave,file on *.* to 'repl9'@'192.168.1.102' identified by '1234569'; Query OK, 0 rows affected (0.01 sec) mysql> flush privileges; Qu ......
¸Õ¿ªÊ¼²Ù×÷Êý¾Ý¿âʱÎÒÒ»°ãÊDz»Ê¹ÓÃʲôgui¹¤¾ßµÄ£¬ÎÒÊÇÖ±½ÓʹÓÃcmdϲÙ×÷µÄ£¬¸Ð¾õÓÃÆðÀ´Ò²Í¦²»´íµÄ¡£
×î½ü¿´µ½ÓÐgui¹¤¾ßÄÇÒ²²»´í°¡£¬¾ÍÏÂÀ´Ê¹ÓÃһϣ¬ÎÒϲ»¶ÏµÄÊÇѹËõ°üÃâ°²×°µÄ£¬ÕâÑù¸Ð¾õ±È½ÏÊæ·þ°¡
´ò¿ª²éѯ¹¤¾ßÊǾ¹È»³ö´íÁË£¬²»¹ýÄÜÕý³£Ê¹Óõģ¬µ±Ê±Ò²Ã»ÓÐ×¢Ò⣬½ñÌìÌØÒâµÄ¿´ÁËÒ»ÏÂ
Ó¦¸ÃÊÇmysqlqb_functions.xml¼ÓÔØ ......