Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ÀûÓÃMySQLDriverCSʵÏÖÔÚ.NET»·¾³Ï·ÃÎÊMySQLÊý¾Ý¿â

using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using MySQLDriverCS;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MySQLConnection conn = null;
        conn = new MySQLConnection(new MySQLConnectionString("127.0.0.1", "Dvbbs", "root", "123456").AsString);
        conn.Open();
        MySQLCommand commn = new MySQLCommand("set names gb2312",conn);
        commn.ExecuteNonQuery();
        string sql = "select title,topicID, boardId ,dateandtime,hits  from  Dv_topic order by dateandtime desc limit 10";
        MySQLDataAdapter mda = new MySQLDataAdapter(sql,conn);
        DataSet ds = new DataSet();
        mda.Fill(ds, "table1");
        this.Repeater1.DataSource = ds;
        this.Repeater1.DataBind();
        conn.Close();
    }
}
¾ÍÕâÑù¾Í¿ÉÒÔʵÏÖÔÚ.NET»·¾³Ï¶ÔMySQLÊý¾ÝµÄ·ÃÎÊ¡£ÔÚÕâ֮ǰ»¹Òª×öһЩ׼±¸£¬ÏÂÔØMySQLDriverCS£¬°²×°£¬ÔÚ°²×°Îļþ¼ÐÏÂÃæÕÒµ½MySQLDriver.dll£¬È»ºó½«MySQLDriver.dllÌí¼ÓÒýÓõ½ÏîÄ¿ÖоÍOKÁË¡£Ò²ÐíÄã¶ÔÕâÐдúÂë
MySQLCommand commn = new MySQLCommand("set names gb2312",conn);
        commn.ExecuteNonQuery();
²»Ì«Àí½â¡£ÕâÊÇÒòΪÈç¹ûûÓÐÕâ¾ä»


Ïà¹ØÎĵµ£º

mysql Êý¾Ýµ¼³öµÄÁ½ÖÖ·½Ê½

MySQLÓкܶà¿ÉÒÔµ¼ÈëÊý¾ÝµÄ·½·¨£¬È»¶øÕâЩֻÊÇÊý¾Ý´«ÊäÖеÄÒ»°ë£¬ÁíÍâµÄÒ»°ãÊÇ´ÓMySQLÊý¾Ý¿âÖе¼³öÊý¾Ý¡£ÓÐÐí¶àµÄÔ­ÒòÎÒÃÇÐèÒªµ¼³öÊý¾Ý¡£Ò»¸öÖØ
ÒªµÄÔ­ÒòÊÇÓÃÓÚ±¸·ÝÊý¾Ý¿â¡£Êý¾ÝµÄÔì¼Û³£³£ÊÇ°º¹óµÄ£¬ÐèÒª½÷É÷´¦ÀíËüÃÇ¡£¾­³£µØ±¸·Ý¿ÉÒÔ°ïÖú·ÀÖ¹±¦¹óÊý¾ÝµØ¶ªÊ§£»ÁíÍâÒ»¸öÔ­ÒòÊÇ£¬Ò²ÐíÄúÏ£Íûµ¼³öÊý¾ÝÀ´¹²
Ïí¡£ ÔÚÕâ¸öÐÅÏ¢¼¼Ê ......

MySqlÖеÄTimestampÀàÐÍ×ֶεÄʹÓÃ

TIMESTAMPÁÐÀàÐÍÌṩһÖÖÀàÐÍ£¬Äã¿ÉÒÔʹÓÃËü×Ô¶¯µØÓõ±Ç°µÄÈÕÆÚºÍʱ¼ä±ê¼ÇINSERT»òUPDATEµÄ²Ù×÷¡£Èç¹ûÄãÓжà¸öTIMESTAMPÁУ¬Ö»ÓеÚÒ»¸ö×Ô¶¯¸üС£
  ×Ô¶¯¸üеÚÒ»¸öTIMESTAMPÁÐÔÚÏÂÁÐÈκÎÌõ¼þÏ·¢Éú£º
ÁÐûÓÐÃ÷È·µØÔÚÒ»¸öINSERT»òLOAD   DATA   INFILEÓï¾äÖÐÖ¸¶¨¡£     
ÁÐûÓÐÃ÷È·µØÔÚÒ ......

MySQL Master/Slave Server ¼ÜÉè



»·¾³£ºÁ½Ì¨·þÎñÆ÷IP:192.168.30.57\192.168.30.58
1¡¢ÏÂÔØmysql-5.0.86-linux-i686-glibc23.tar.gz µ½http://dev.mysql.com/downloads/mysql/5.0.html#linuxÏÂÔØ
2¡¢½âѹ tar -zxvf
mysql-5.0.86-linux-i686-glibc23.tar.gz
3¡¢´´½¨Á´½Ó ln -s
mysql-5.0.86-linux-i686-g ......

mysql ÀàÐÍת»»º¯Êý

12.8.   Castº¯ÊýºÍ²Ù×÷·û  
BINARY    
BINARY²Ù×÷·û½«ºóÃæµÄ×Ö·û´®Å׸øÒ»¸ö¶þ½øÖÆ×Ö·û´®¡£ÕâÊÇÒ»ÖÖ¼òµ¥µÄ·½Ê½À´´ÙʹÖð×Ö½Ú¶ø²»ÊÇÖð×Ö·ûµÄ½øÐÐÁбȽϡ£ÕâʹµÃ±È½ÏÇø·Ö´óСд£¬¼´Ê¹¸ÃÁв»±»¶¨ÒåΪ   BINARY»ò   BLOB¡£BINARYÒ²»á²úÉú½áβ¿Õ°×£¬´Ó¶ø¸ü¼ÓÏÔ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ