MySQLѧϰ
×öÈí¼þÊý¾Ý¿â±Ø²»¿ÉÉÙ£¬ÎÒÑ¡ÔñÁËMySQL¡£
Ê×Ïȵ½http://dev.mysql.com/downloads/ÏÂÔغÃMySQL5.1ºÍMySQL GUI TOOLS
ϵ½µçÄÔÉÏ,È»ºó°²×°£¬ÏÈ×°5.1ÔÙ×°gui tools ,һ·ȷ¶¨°É¡£
ŪºÃºó£¬µã¿ªMySQL Query Browser£¬¾Í¿ÉÒÔ²Ù×÷Êý¾Ý¿âÁË¡£
MySQLµÄÇý¶¯³ÌÐòÊÇGUITOOLS°²×°Ä¿Â¼/java/libϵÄmysql-connector-java-5.0.4-bin.jar
°ÑËü·Åµ½ */tomcat6.0/lib ÏÂÃ棬ÔÙ°ÑÕâÌõ·¾¶¼ÓÈëµ½classpathÀï±ß£¬ÔÚjspÖоͿÉÒÔÓÃÁË¡£
ÔÚ.java³ÌÐòÖУ¬ÒªÅäÖúù¹½¨Â·¾¶£¬·½·¨£ºÅäÖù¹½¨Â·¾¶->¿â->Ìí¼ÓÍⲿjar->Ñ¡ÔñÊý¾Ý¿âÇý¶¯ ¾ÍOKÀ²¡£
ÏÂÃæÊÇÒ»¸öµäÐ͵ÄʹÓÃÊý¾Ý¿âµÄÀý×Ó£º£¨ÔÚʹÓÃÇ°£¬Òª½¨ºÃÊý¾ÝÔ´ºÍ±íŶ£©
package mypackage;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.sql.Statement;
public class ConToDBTest {
public static void main(String[] args) {
String user="root"; //̞
String pass="root"; //ÃÜÂë
String dbName="test"; //Êý¾ÝÔ´Ãû
String tableName="student"; //±íÃû
String driver="com.mysql.jdbc.Driver"; //Êý¾Ý¿âÇý¶¯³ÌÐò
String url="jdbc:mysql://localhost:3306/"+dbName;//Áª½á·¾¶
String sqlStr; //SQLÓï¾ä
Connection con=null; //Á¬½Ó¶ÔÏó
Statement stmt=null; //Óï¾äÈÝÆ÷
ResultSet rs=null; //½á¹û¼¯
try{
Class.forName(driver); //¼ÓÔØÇý¶¯
con=DriverManager.getConnection(url,user,pass); //Á¬½ÓÊý¾Ý¿â
stmt=con.createStatement(); //´´½¨ÈÝÆ÷
//ÔÚ±ístudentÖвåÈë¼Ç¼
sqlStr="insert into "+tableName+" values('000099988','zhangli',21)";
stmt.executeUpdate(sqlStr);
//²éÕÒ±ístudentÖеļǼ
sqlStr="select * from "+tableName;
rs=stmt.executeQuery(sqlStr);
ResultSetMetaData rsmd=rs.getMetaData();//»ñÈ¡ÔªÊý¾Ý
//ÏÔʾÊôÐÔÃû
int j=0;
j=rsmd.getColumnCount();
for(int k=0;k<j;k++){
System.out.print(rsmd.getColumnName(k+1));
System.out.print("\t");
}
System.out.print("\n");
//ÏÔʾ¼Ç¼
while(rs.next()){
for(int i=0;i<j;i++){
System.out.print(rs.getString(i+1));
Sys
Ïà¹ØÎĵµ£º
ÒÔmysql-noinstall-5.1.6(win32)ΪÀý
1>°ÑѹËõÎļþmysql-noinstall-5.1.6-alpha-win32.zip½âѹµ½Ò»¸öĿ¼Ï£¬ÔÚ»·¾³±äÁ¿ÖÐÉèÖÃMYSQL_HOME£¬°Ñ%MYSQL_HOME%\bin ¼Ó
Èëµ½ path¡£
2>´´½¨my.iniÅäÖÃÎļþ,ÄÚÈÝÈçÏ£º
[mysqld]
#ÉèÖÃbasedirÖ¸ÏòmysqlµÄ°²×°Â·¾¶
basedir=...\mysql
datadir=...\mysql\data
my.iniÎ ......
¡¡¡¡ÒÔMySQL-server-4.0.14-0.i386.rpmΪÀý£¬·ÅÔÚ/dataĿ¼ÏÂ
¡¡¡¡cd /data
¡¡¡¡rpm -ivh MySQL-server-4.0.14-0.i386.rpm
¡¡¡¡°²×°Íê³ÉºóÔÚ/usr/share/mysqlĿ¼ÖлáÓÐÒ»¸ömysqlµÄÆô¶¯½Å±¾mysql.server¼°Ê¾ÀýÅäÖÃÎļþµÈ(Èçmy-huge.cnf¡¢my-large.cnf¡¢my-medium.cnf)
¡¡¡¡¿½±´Ò»¸öʾÀýÅäÖÃÎ ......
ÅäÖû·¾³:UUbuntu 8.04
1.°²×°vsftpd
sudo apt-get install vsftpd
2.´´½¨guestÓû§
vsftpd°²×°µÄʱºò»á×Ô¶¯°²×ªÒ»¸öftpÓû§£¬ÔÚpasswdÖÐɾ³ý
sudo useradd virtual
ÉèÖÃvirtualµÄÃÜÂëΪwebftp
sudo passwd virtual
±à¼virtualÓû§µÄÖ÷Ŀ¼²¢ÉèÖÃshell
sudo vim /etc/passwd
ÎÒÉèÖõÄÊÇvirtual:x:1001: ......
ÔÚWindowsXPÖдò¿ªDOS£¬Í¨¹ýÊäÈëÃüÁî“mysql -u root -p”Çл»µ½mysqlÏ£¬Çл»Ê§°Ü£¬ÈçÏÂËùʾ£º
Microsoft Windows XP [°æ±¾ 5.1.2600]
(C) °æȨËùÓÐ 1985-2001 Microsoft Corp.
C:\>mysql -u root -p
'mysql' ²»ÊÇÄÚ²¿»òÍⲿÃüÁҲ²»ÊÇ¿ÉÔËÐеijÌÐò
»òÅú´¦ÀíÎļþ¡£
......