bind+dlz+mysqlʵÏÖÇøÓò¼Ç¼¶¯Ì¬¸üÐÂ
BIND-DLZʵÑé:http://bind-dlz.sourceforge.net/
ʵÑé»·¾³:RHEL4,BIND-9.5.0-P2.tar.gz(9.4.0ÒÔÉϰ汾¶¼ÒѺ¬DLZ²¹¶¡),Mysql-5.0.56.tar.gz
1¡¢°²×°mysql(ÏȰ²×°gccµÈÏà¹ØÈí¼þ°ü)
#tar zxvf mysql-5.0.56.tar.gz
#cd mysql-5.0.56
#./configure --prefix=/usr/local/mysql --localstatedir=/usr/loal/mysql/data -- libexecdir=/usr/local/mysql/lib --disable-shared
#make
#make install
#cd /usr/local/mysql/
#groupadd -g 1003 mysql
#useradd -g 1003 mysql
#chown -R mysql .
#chgrp -R mysql .
#chown -R mysql lib
#./bin/mysql_install_db --user=mysql //ÒÔmysqlµÄÓû§Éí·Ý°²×°
#chown -R root .
#./bin/mysqld_safe --user=mysql & //ÔÚºǫ́Æô¶¯mysql
# cd /root/mysql-5.0.56
# cp support-files/my-medium.cnf /etc/my.cnf
# cp support-files/mysql.server /etc/rc.d/init.d/mysqld
# chmod 700 !$
# chkconfig --add mysqld
# chkconfig --list mysqld
mysqld 1:off 2:on 3:on 4:on 5:on 6:off
# service mysqld start[restart/reload/stop]
# vi /etc/my.cnf
add this:(·ÀÖ¹mysql·þÎñÆ÷ÎÞ²éѯºó8Сʱ×Ô¶¯ÖØÁ¬)
wait_timeout = 86400
interactive_timeout = 86400
#/usr/local/mysql/bin/mysqladmin -uroot password 'aptech'
#./bin/mysql -uroot -paptech
#echo "PATH=$PATH:/usr/local/mysql/bin" >> /etc/profile
#. !$
2¡¢°²×°bind
#tar zxvf bind-9.5.0-P2.tar.gz
#cd bind-9.5.0-P2
#./configure --prefix=/usr/local/bind9 --with-dlz-mysql=/usr/local/mysql --enable-threads=no
//--with-dlz-mysql=/usr/local/mysql ÒªÇóbind°²×°ÖÐÖ§³ÖDLZ
//--enable-threads=no ¹Ø±Õ¶àÏß³Ì
//--disable-openssl-version-check ½ûÖ¹openssl°æ±¾µÄ¼ì²é
#make
#make install
3¡¢´´½¨database,table
Ïà¹ØÎĵµ£º
¼ÙÉèÄãÊÇÒ»¸öAccess¿ª·¢ÈËÔ±£¬¶øÄãÏëÒÆÖ²Ò»¸öAccessºǫ́µ½Ò»¸ö±¾µØµÄMySQL ·þÎñÆ÷ÓÃÓÚ¿ª·¢ºÍ²âÊÔ¡£Ä㽫ά»¤Äã×Ô¼ºµÄ½â¾ö·½°¸²¢ÀÖÓÚʹÓÃCommunity Server
¡¡¡¡µÚÒ»²½——°²×°MySQL
¡¡¡¡µ½http://dev.mysql.com/downloads/ ÏÂÔØÕâ¸ö·þÎñÆ÷¡¢MySQL GUI¹¤¾ßºÍMySQL ODBCÇý¶¯¡£Äã¿ÉÒÔÑ¡ÔñµÄ·þÎñÆ÷ÓУº5.0, 5.1»ò6.0 ......
JDBCÁ¬½ÓMySQL
JDBCÁ¬½ÓMySQL
¼ÓÔØ¼°×¢²áJDBCÇý¶¯³ÌÐò
Class.forName("com.mysql.jdbc.Driver");
Class.forName("com.mysql.jdbc.Driver").newInstance();
JDBC URL ¶¨ÒåÇý¶¯³ÌÐòÓëÊý¾ÝÔ´Ö®¼äµÄÁ¬½Ó
±ê×¼Óï·¨£º
<protocol£¨Ö÷ҪͨѶÐÒ飩>:<subprotocol£¨´ÎҪͨѶÐÒ飬¼´Çý¶¯³ÌÐòÃû³Æ£©>:<data so ......
MySQLÊÇÎÒÃDZȽϳ£ÓõÄÒ»ÖÖÊý¾Ý
¿âÈí¼þ¡£ËüÓÐ×ÅÖî¶àµÄÓŵ㣬È翪ԴµÄ£¬Ãâ·ÑµÄµÈµÈ¡£ÆäʵËü»¹ÓÐÒ»¸öºÜºÃµÄÌØµã£¬ÄǾÍÊÇÓжàÖÖÒýÇæ¿ÉÒÔ¹©ÄãÑ¡Ôñ¡£Èç¹ûÈü
³µÊÖÄܸù¾Ý²»Í¬µÄ·¿ö£¬µØÐÎËæÊÖ¸ü»»ÓëÖ®×îÊÊÒ˵ÄÒýÇæ£¬ÄÇôËûÃǽ«´´ÔìÆæ¼£¡£È»¶øÄ¿Ç°ËûÃÇ»¹×ö²»µ½ÄÇÑù±ã½ÝµÄ¸ü»»ÒýÇæ£¬µ«ÊÇÎÒÃÇÈ´¿ÉÒÔ£¡
Ëù ......
1.1.1 MySQLÏÂÔØ¡¢°²×°ÓëÆô¶¯
ÔÚʹÓÃMySQL֮ǰ£¬ÐèÒª½¨Á¢Êý¾Ý¿âµÄ»·¾³À´´´½¨Êý¾Ý±í£¬Ê×ÏÈÎÒÃÇÐèÒª°²×°¸ÃÊý¾Ý¿â»·¾³£¬¼´MySQL¡£
1¡¢ÏÂÔØMySQL
MySQLµÄ¹Ù·½ÍøÕ¾ÊÇhttp://www.mysql.org/£¬Èçͼ2-9Ëùʾ£º
ͼ2-9 MySQL¹Ù·½ÍøÕ¾
µ±Ç°Îȶ¨°æ±¾Îª5.1£¬ÎÒÃÇÑ¡ÓÃMySQL 5.1.22×÷ΪÊý¾Ý¿â·þÎñÆ÷£¬µ½Æä¹Ù·½ ......
ÔÚÊý¾Ý¿â±íÖУ¬¶Ô×ֶν¨Á¢Ë÷Òý¿ÉÒÔ´ó´óÌá¸ß²éѯËÙ¶È¡£¼ÙÈçÎÒÃÇ´´½¨ÁËÒ»¸ö mytable±í£º
CREATE TABLE mytable(
ID INT NOT NULL,
username VARCHAR(16) NOT NULL
);
ÎÒÃÇËæ»úÏòÀïÃæ²åÈëÁË10000Ìõ¼Ç¼£¬ÆäÖÐÓÐÒ»Ìõ£º5555, admin¡£
ÔÚ²éÕÒusername="admin"µÄ¼Ç¼ SELECT * from mytable WHERE username='admin';ʱ£¬Èç¹ ......