mySqlÊý¾Ý¿âÁ¬½Ó
Class.forName("com.mySQL.jdbc.Driver");
String strUrl="jdbc:mysql://localhost:3306/stu?useUnicode=true&characterEncoding=GB2312";
String strUser="nuey";
String strPassword="password";
Connection conn=DriverManager.getConnection(strUrl, strUser, strPassword);
Statement rs=conn.createStatement();
String strSqlInsert="insert into tblScore (Name,Class,Score) values ('"+strName+"','"+strClass+"','"+strScore+"')";
int iResult=rs.executeUpdate(strSqlInsert);
if(iResult!=0)
{
out.println("Ìí¼Ó³É¹¦£¡");
}
else
{
out.println("Ìí¼Óʧ°Ü£¡");
}
µ¼Èëjar°ü£¬È»ºóÔõôµ÷ÊÔ¶¼ÊdzöÏÖ
java.lang.ClassNotFoundException: com.mySql.jdbc.Driver£¬
Ö´Ðе½µÚÒ»²½¾Í³ö´í£¬
ÉÏmysqlÍøÕ¾ÏÂ×îеÄÇý¶¯£¬»¹ÊDz»ÐУ¬
ÓôÃÆÖ®¼«£¬×îºó·¢ÏÖʱ´óСдµÄÎÊÌ⣬
µÚÒ»¾äÓ¦¸ÃÊÇ
Class.forName("com.mysql.jdbc.Driver");
Ïà¹ØÎĵµ£º
1¡¢ÏÔʾÊý¾Ý¿âÁÐ±í¡£
show databases;
¸Õ¿ªÊ¼Ê±²ÅÁ½¸öÊý¾Ý¿â£ºmysqlºÍtest¡£mysql¿âºÜÖØÒªËüÀïÃæÓÐMYSQLµÄϵͳÐÅÏ¢£¬ÎÒÃǸÄÃÜÂëºÍÐÂÔöÓû§£¬Êµ¼ÊÉϾÍÊÇÓÃÕâ¸ö¿â½øÐкÃ×÷¡£
2¡¢ÏÔʾ¿âÖеÄÊý¾Ý±í£º
use mysql£» £¯£¯´ò¿ª¿â£¬Ñ§¹ýFOXBASEµÄÒ»¶¨²»»áİÉú°É
show tables;
3¡¢ÏÔʾÊý¾Ý±íµÄ½á¹¹£º
describe ±í ......
mysqlÎļþµ¼ÈëÂÒÂëÎÊÌâµÄ½â¾ö£º
1 ÃüÁî²ì¿´×Ö·ûÉèÖá£
mysql> show variables like "%char%";
2 ½«²»ÊÇutf-8µÄ¶¼¸Ä³Éutf8¡£Ö»ÓÐfilesystem²»±ä;
| Variable_name | Value
&nb ......
Ò»¡¢MySQL »ñµÃµ±Ç°ÈÕÆÚʱ¼ä º¯Êý
1.1 »ñµÃµ±Ç°ÈÕÆÚ+ʱ¼ä£¨date + time£©º¯Êý£ºnow()
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2008-08-08 22:20:46 |
+---------------------+
³ýÁË now() º¯ÊýÄÜ»ñµÃµ±Ç°µÄÈÕÆÚʱ¼äÍ⣬MySQL Öл¹ÓÐÏÂÃæµÄº¯Êý£º
current_tim ......
ÕâÁ½ÌìÎÒ×°ÁËUBUNTU £¬ÔÚ±àÒë°²×°MYSQLµÄʱºòûÓгöʲôÎÊÌ⣬
µ½scripts/mysql_install_db --user=mysql
ÕâÒ»²½Ê±£¬µÃµ½ÈçÏ´íÎó
FATAL ERROR: Can't find mysqld. Please specify your installation
directory with the '--basedir=' option.
FATAL ERROR: Could not find SQL file '/fill_help_tables.sql'
µ½ÍøÉ ......
groupadd mysql
н¨Ò»¸öÃûΪmysqlµÄÓû§×é
useradd -g mysql mysql
ÔÚmysqlÓû§×éÏÂн¨Ò»¸öÃûΪmysqlµÄÓû§
gunzip ½âѹÏÂÔØµ½µÄ.gzÎļþ
cd mysql-VERSION
½øÈë½âѹºóµÄĿ¼
CFLAGS="-O3 -mcpu=pentium4" CXX=gcc CXXFLAGS="-O3 -march=pentium4 -felide-constructors -fno-exceptions -fno-rtti" ./configu ......