C#Á¬½ÓMYSQL£¬¶ÁÈ¡ÖÐÎÄÎÊÌâ
MySQLConnection DBConn; DBConn = new MySQLConnection(new MySQLConnectionString("localhost" , "admin" , "root" , "123456" , 3306).AsString); DBConn.Open(); MySQLCommand DBComm; DBComm = new MySQLCommand("select * from tb1" , DBConn); MySQLDataReader DBReader = DBComm.ExecuteReaderEx(); try { while (DBReader.Read()) { Console.WriteLine("Host = {0} and User = {1}", DBReader.GetString(0),DBReader.GetString(1)); //×¢£ºDBReader.GetString(0)ÔÚÊý¾Ý¿âÖдæµÄÊÇÖÐÎÄ£¬µ«²éѯ³öÀ´ÊÇ¡®ÂÒÂ롯 ÏÔʾµ½Ò³ÃæÊÇÈ«ÊÇ£¿ Ôõô½â¾öÕâÎÊÌ⣿Êý¾Ý¿â±àÂë¸ñʽûÎÊÌâ(gb2312) ±ð˵ÅäÖÃweb.config£¬ÊÔ¹ýÁË£¬²»¹ÜÓᣠҲ±ð˵±àÂë½âÂ룬¶¼²»¹ÜÓᣠ} } finally { DBReader.Close(); DBConn.Close(); } DBConn.Close();
û»Ø»Ø´ð£¿ Data Source=localhost;Port=3306;User ID=???;Password=????;Initial Catalog=?????;Pooling=true;Allow Zero Datetime=true;charset=gb2312 ÉÏÃæµÄÊÇconnectstring ÎÒ¿ñ¶¥Äã Ö±µ½ÎÊÌâ½â¾öΪֹ ÔÙ¶¥ ÎÒÍùËÀÀï¶¥ÒýÓà Data Source=localhost;Port=3306;User ID=???;Password=????;Initial Catalog=?????;Pooling=true;Allow Zero Datetime=true;charset=gb2312 ÄãÒâ˼ÊÇDBConn = new MySQLConnection(new MySQLConnectionString("localhost" , "admin" , "root"
Ïà¹ØÎÊ´ð£º
Ò»¸öÐÐÒµÍøÕ¾£¬ÒªÊµÏֵŦÄÜÒªÇóΪ£º Ò»ËÑË÷±íµ¥¿ÉÑ¡ËÑË÷ ²úÆ·/×ÊѶ/É̼ң¬ËÑË÷ʱϣÍûÏÈËѱêÌâºóÈ«ÎÄ£¬µ±Ç°µÄÊý¾ÝÁ¿¹À¼Æ3Íò¶à£¬¶¨Î»ÆÚÍûÔÚ°ÙÍò¼¶Ò²¿ÉÓᣠÊý¾ÝÀàÐÍΪinnodb£¬µ±Ç°µÄ·½·¨ÊǶԹؼü´Ê½øÐÐ ......
ÎÒ֮ǰµ¼ÈëµÄÊý¾Ý¿â£¬ÏÖÔÚɾ³ý²»ÁË£¬ÓÃÁËÃüÁîÐк͹¤¾ß¶¼²»ÐУ¬ÖØÆôÒ²²»ÐУ¬ÕâÊÇÎªÊ²Ã´ÄØ£¿ ÄãÊÇÈçºÎɾ³ýµÄ£¿ ÓÐʲôÌáʾ£¿ ÎÊÌâ˵Ã÷Ô½Ïêϸ£¬»Ø´ðÒ²»áԽ׼ȷ£¡²Î¼ûÈçºÎÌáÎÊ¡££¨ÌáÎʵÄÖǻۣ©
......
ÎÒÔÚ×¢²áÒ³ÃæÐ´ÈëÁËÈçÏ´úÂ룺 <?php $conn=mysql_connect("localhost","root","614510")or die("Êý¾Ý¿â·þÎñÆ÷Á¬½Ó´íÎó".mysql_error()); & ......
ÎÒÒÔǰ°²×°ÁËÒ»´Î£¬ºóÀ´Ð¶ÔØÁË£¬ÏÖÔÚÔÙ°²×°µÄʱºò£¬Ìáʾ´íÎó£ºError 1305.Error reading from file C:DOCUME~1\LOCALS~1\Temp\mysql_server.msi.Verify that the file exists and that you can access it. ¿ ......
ÎÒÒÔǰ°²×°ÁËÒ»´Î£¬ºóÀ´Ð¶ÔØÁË£¬ÏÖÔÚÔÙ°²×°µÄʱºò£¬Ìáʾ´íÎó£ºError 1305.Error reading from file C:DOCUME~1\LOCALS~1\Temp\mysql_server.msi.Verify that the file exists and that you can access it. ¿ÉÊÇÎÒÕÒ ......