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

jdbcÁ¬½ÓmysqlÊý¾Ý¿â

ÏÈÏÂÔØÒ»¸ömysqlµÄÇý¶¯Æ÷£º£¨ÎÒϵÄÊÇmysql-connector-java-3.1.11-bin.jar£©
½«Ëü·Åµ½java\libĿ¼ÏÂ
ÔÚ»·¾³±äÁ¿µÄCLASSPATHÀïÌí¼Ó¸ÃÀࣨ%JAV_HOMG%\lib\mysql-connector-java-3.1.11-bin.jar)
³ö²âÊԸöδúÂë¼´¿É£º
import java.net.URL;
import java.sql.*;
public class sqlTest {
 public static void main(String[] args) {
    try{
  String Driver="org.gjt.mm.mysql.Driver";
  String URL="jdbc:mysql://localhost:3306/jietest";
  String user="root";
  String password="2008051082";
  
  Connection con=null;
  Statement sm=null;
  ResultSet rs=null;
  
   Class.forName(Driver);
   con=DriverManager.getConnection(URL,user,password);
   
   String sql="insert into info values('yating','2008052231','13632355056','3','3','2','3');";
   sm=con.createStatement();
   sm.execute(sql);
   String sql2="select * from info";
   rs=sm.executeQuery(sql2);
   while(rs.next()) {
    System.out.println(rs.getString("name")+" "+
    rs.getString("id"));
   }
   System.out.println("Create successfully!");
   sm.close();
   con.close();
  }catch(SQLException ex) {
   System.out.println("\n***SQLException caught ***\n");
   while(ex!=null) {
    System.out.println("SQLState:"+ex.getSQLState());
    System.out.println("Message:"+ex.getMessage());
    System.out.println("Vendor:"+ex.getErrorCode());
    ex=ex.getNextException();
    System.out.println("");
   }
  }catch(java.lang.Exception ex) {
   ex.printStackTrace();
  }
 }
}
 


Ïà¹ØÎĵµ£º

MySQL EVENT


MySQL EVENT 
À´Ô´£ºhttp://samyu.blog.51cto.com/344284/146011
event_scheduler:
The MySQL event scheduler is a thread that runs in the background looking for events to execute. It spends a lot of time sleeping -- and won't do anything unless the new global variable "event_scheduler" is set t ......

mysqlÎĵµÑ§Ï°3.6

Ô¶³ÌµÇ¼ -h IPµØÖ·
ctrl + d Í˳ö »ò \q »ò quit
select version(); µ±Ç°°æ±¾
current_dateµ±Ç°ÈÕÆÚ »òcurdate() »ò current_date()
SELECT name, birth, curdate(),(year(curdate())-year(birth)) - (right(curdate(),5)<right(birth,5)) as age from ±í ORDER BY name;
year ÌáÈ¡Ä겿·Ö right(curdate(),5)ÌáÈ¡Ó ......

MySQL±¸·Ý¡¢»¹Ô­

»¹Ô­Ò»¸öÊý¾Ý¿â:mysql -h localhost -u root -p123456 www<c:\www.sql
±¸·ÝÒ»¸öÊý¾Ý¿â:mysqldump -h localhost -u root -p123456 www > d:\www2008-2-26.sql
//ÒÔÏÂÊÇÔÚ³ÌÐòÖнøÐвâÊÔ
//$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
$command="mysqldum ......

MySQL½Ì³Ì£ºOrder ByÓ÷¨


ÏȰ´ÕÕÏÂÃæµÄ±í½á¹¹´´½¨mysql_order_by_testÊý¾Ý±í£¬ÎÒÃÇÓÃʵÀýÒ»µãÒ»µã¸æËßÄ㣬MySQL order byµÄÓ÷¨¡£
¡¡¡¡ORDER BY uid ASC
¡¡¡¡°´ÕÕuidÕýÐò²éѯÊý¾Ý£¬Ò²¾ÍÊǰ´ÕÕuid´ÓСµ½´óÅÅÁÐ
¡¡¡¡ORDER BY uid DESC
¡¡¡¡°´ÕÕuidÄæÐò²éѯÊý¾Ý£¬Ò²¾ÍÊǰ´ÕÕuid´Ó´óµ½Ð¡ÅÅÁÐ
¡¡¡¡ÎÒÃÇÀ´¿´
SELECT * from mysql_order_by_test OR ......

MySQL×î»ù´¡ÖªÊ¶¼Ç¼

Ò».°²×°
rpm·½Ê½
rpm -ivf MySQL*
tar·½Ê½
tar xzvf mysql-x.xx.tar.gz
cd mysqlp-x.xx    Éú³Émakefile
./congigure   
make              ±àÒë
 
make install
mysql_install_db
¶þ.Æô¶¯¡¢¹Ø±Õ
ser ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ