mysql jdbcÇý¶¯ÎÊÌâ
1¡¢½¨Á¢ÁËÒ»¸öj2eeÏîÄ¿¡£
2¡¢½«mysqlµÄjdbcÇý¶¯¿½±´µ½WebContent / WEB-INF/ lib Ŀ¼Ï¡£
3¡¢ÔÚÇý¶¯jar°üÉϵãÓÒ¼ü½«jar°üÌí¼Óµ½¹¹½¨Â·¾¶ÖС£
4¡¢È»ºó±àдÓëÊý¾Ý¿âÏà¹ØµÄ´úÂë¡£
5¡¢ÔÚʵÏÖÀàÖÐÌí¼Ómain·½·¨½øÐе¥Ôª²âÊÔ£¬¸÷¸ö·½·¨¶¼ÄÜÕý³£ÔËÐС£
6¡¢´´½¨jspÒ³ÃæÔÚÆäÖд´½¨¶ÔÏóµ÷Óòéѯ·½·¨¡£²úÉú´íÎó¡£
cn.guopeng.bbs.exception.MyRuntimeException: Çý¶¯×°ÔØʧ°Ü¡£java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
cn.guopeng.bbs.dbconn.MysqlDBCONN.<init>(MysqlDBCONN.java:26)
cn.guopeng.bbs.dbconn.MysqlDBCONN.getInstance(MysqlDBCONN.java:31)
cn.guopeng.bbs.factory.DBCONNFactory.getMysqlDBCONN(DBCONNFactory.java:7)
cn.guopeng.bbs.dao.imp.UserDAOIMP.queryByID(UserDAOIMP.java:71)
org.apache.jsp.user_jsp._jspService(user_jsp.java:63)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:374)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
Ö÷ÒªÒâ˼ÔÒò¾ÍÊÇ´ËʱÎÞ·¨ÕÒµ½com.mysql.jdbc.DriverÀà¡£
½â¾ö·½·¨£º½«mysqlµÄjdbcÇý¶¯¿½±´µ½tomcatµÄlibĿ¼Ï£¬´Ëʱ¼´¿ÉÕý³£ÔËÐС£
Ïà¹ØÎĵµ£º
Can't open the mysql.plugin table. Please run mysql_upgrade to create it
µ±Åöµ½ÕâÑùµÄ´íÎóÊÇûÓгõʼ»¯mysqlÊý¾Ý¿â,¿ÉÒÔÔËÐÐÈçϽű¾¾Í¿ÉÒÔ½â¾ö
cd /opt/mysql-5.1.46
cd scripts/
./mysql_install_db --user=mysql --datadir=/usr/local/mysql/var/
ÔËÐÐÈçϵĴúÂë¾Í¿ÉÒÔ½â¾öÉÏÊöÎÊÌâ ......
·ÖÒ³¹¦ÄܵÄʵÏÖÊÇÿÖÖWEB¿ª·¢ÓïÑÔ±ØÐëҪʵÏֵŦÄÜ¡£PHPÒ²ºÃ,JSPÒ²°Õ¡£ÎÒ×¼±¸ÓÃÁ½¸ö·½·¨À´²ûÊöPHP+MYSQLʵÏÖ·ÖÒ³µÄ¹¦ÄÜ¡£
Ò»¡¢·ÖÒ³³ÌÐòµÄÔÀí
·ÖÒ³³ÌÐòÓÐÁ½¸ö·Ç³£ÖØÒªµÄ²ÎÊý£ºÃ¿Ò³ÏÔʾ¼¸Ìõ¼Ç¼£¨$pagesize£©ºÍµ±Ç°Êǵڼ¸Ò³£¨$page£©¡£ÓÐÁËÕâÁ½¸ö²ÎÊý¾Í¿ÉÒԺܷ½±ãµÄд³ö·ÖÒ³³ÌÐò£¬ÎÒÃÇÒÔMySqlÊý¾Ý¿â×÷ΪÊý¾ÝÔ´£¬ ......
(1)
´æ´¢¹ý³ÌÊÇÊý¾Ý¿â·þÎñÆ÷¶ËµÄÒ»¶Î³ÌÐò.
mysqlµÄ´æ´¢¹ý³Ì,Ö»Óа汾ÊÇmysql5.0»òÒÔÉϵIJÅÓдËÌØÐÔ.
(2)
ʲôʱºòÐèÒªÓô洢¹ý³Ì
´æ´¢¹ý³Ìͨ³£ÊÇһЩ¾³£ÒªÖ´ÐеÄÈÎÎñ£¬ÕâЩÈÎÎñÍùÍùÊÇÕë¶Ô´óÁ¿µÄ¼Ç¼¶ø½øÐеġ£ÔÚ·þÎñÆ÷ÉÏÖ´Ðд洢¹ý³Ì£¬¿ÉÒÔ
¸ÄÉÆÓ¦ÓóÌÐòµÄÐÔÄÜ¡£ÕâÊÇÒòΪ£º
2.1.
·þÎñÆ÷ÍùÍù¾ßÓÐÇ¿´óµÄ¼ÆËãÄÜÁ¦ºÍËÙ ......
ÅäÖø´ÖÆ
1.ÅäÖÃserver-idºÍlog-bin
2.Ö÷¿âÖÐÌí¼ÓÓÃÓÚ¸´ÖƵÄÓû§
GRANT REPLICATION SLAVE,reload,super ON *.*
TO 'repl'@'%.vm.dba.com' IDENTIFIED BY 'slavepass'
3.ÔÚ´Ó¿âÉÏÉèÖÃÓÃÓÚ¸´ÖƵÄÑ¡Ïî
server-id
master-host
master-user
master-password
--read-only ¸ÃÑ¡ÏîÈôӷþÎñÆ÷Ö»ÔÊÐíÀ´× ......