±È½Ï²»´íµÄmysql²Ù×÷Àà
<?php
/*
* by:lenush
* qicq:707207845
* email:lenus-h@163.com
* site:www.hackthiswebsite.cn
* that's all
*
*/
class mysql{
private $db_host; //Êý¾Ý¿âÖ÷»ú
private $db_user; //Êý¾Ý¿âÓû§Ãû
private $db_pwd; //Êý¾Ý¿âÓû§ÃûÃÜÂë
private $db_database; //Êý¾Ý¿âÃû
private $conn; //Êý¾Ý¿âÁ¬½Ó±êʶ;
private $result; //Ö´ÐÐqueryÃüÁîµÄ½á¹û×ÊÔ´±êʶ
private $sql; //sqlÖ´ÐÐÓï¾ä
private $row; //·µ»ØµÄÌõÄ¿Êý
private $coding; //Êý¾Ý¿â±àÂ룬GBK,UTF8,gb2312
private $bulletin = true; //ÊÇ·ñ¿ªÆô´íÎó¼Ç¼
private $show_error = true; //²âÊԽ׶Σ¬ÏÔʾËùÓдíÎó,¾ßÓа²È«Òþ»¼,ĬÈϹرÕ
private $is_error = false; //·¢ÏÖ´íÎóÊÇ·ñÁ¢¼´ÖÕÖ¹,ĬÈÏtrue,½¨Òé²»ÆôÓã¬ÒòΪµ±ÓÐÎÊÌâʱÓû§Ê²Ã´Ò²¿´²»µ½ÊǺܿàÄÕµÄ
/*¹¹Ô캯Êý*/
public function __construct($db_host,$db_user,$db_pwd,$db_database,$conn,$coding){
$this->db_host=$db_host;
$this->db_user=$db_user;
$this->db_pwd = $db_pwd;
$this->db_database=$db_database;
$this->conn=$conn;
$this->coding=$coding;
$this->connect();
}
/*Êý¾Ý¿âÁ¬½Ó*/
public function connect()
{
if($this->conn=="pconn"){
//ÓÀ¾ÃÁ´½Ó
$this->conn=mysql_pconnect($this->db_host,$this->db_user,$this->db_pwd);
}else{
&
Ïà¹ØÎĵµ£º
innodb_buffer_pool_size
Èç¹ûÓÃInnodb£¬ÄÇôÕâÊÇÒ»¸öÖØÒª±äÁ¿¡£Ïà¶ÔÓÚMyISAMÀ´Ëµ£¬Innodb¶ÔÓÚbuffer size¸üÃô¸Ð¡£MySIAM¿ÉÄܶÔÓÚ´óÊý¾ÝÁ¿Ê¹ÓÃĬÈϵÄkey_buffer_sizeÒ²»¹ºÃ£¬µ«InnodbÔÚ´óÊý¾ÝÁ¿Ê±ÓÃĬÈÏÖµ¾Í¸Ð¾õÔÚÅÀÁË¡£ InnodbµÄ»º³å³Ø»á»º´æÊý¾ÝºÍË÷Òý£¬ËùÒÔ²»ÐèÒª¸øϵͳµÄ»º´æÁô¿Õ¼ä£¬Èç¹ûÖ»ÓÃInnodb£¬¿ÉÒÔ°ÑÕâ¸öÖµÉèΪ ......
Unix&Linux£º
1.ÓÃroot»òÕßÔËÐÐmysqldµÄÓû§µÇ¼ϵͳ£»
2£®ÀûÓÃkillÃüÁî½áÊøµômysqldµÄ½ø³Ì£»
3£®Ê¹ÓÃ--skip-grant-tables²ÎÊýÆô¶¯MySQL Server
shell>mysqld_safe --skip-grant-tables &
4.Ϊroot@localhostÉèÖÃÐÂÃÜÂë
shell>mysqladmin -u root flush-privileges password "newpassword" ......
£ÛתÔØ£ÝMySQL£ºMySQL ´´½¨´æ´¢¹ý³Ì£¨MySQL 5.0£©
2008-09-11 22:14
MySQL ´æ´¢¹ý³ÌÊÇ´Ó MySQL 5.0 ¿ªÊ¼Ôö¼ÓµÄй¦ÄÜ¡£´æ´¢¹ý³ÌµÄÓŵãÓÐÒ»Âá¿ð¡£²»¹ý×îÖ÷ÒªµÄ»¹ÊÇÖ´ÐÐЧÂʺÍSQL ´úÂë·â×°¡£ÌرðÊÇ SQL ´úÂë·â×°¹¦ÄÜ£¬Èç¹ûûÓд洢¹ý³Ì£¬ÔÚÍⲿ³ÌÐò·ÃÎÊÊý¾Ý¿âʱ£¨ÀýÈç PHP£©£¬Òª×éÖ¯ºÜ¶à SQL Óï¾ä¡£ÌرðÊÇÒµÎñÂß¼¸´ÔÓµÄʱº ......
Èý²½×ߣº
1.ÔÚwindows-->perspective-->DB browser
2.Create a database connection profile
Çý¶¯ÏÂÔØ£º http://dev.mysql.com/downloads/
ÎļþÃû£ºmysql-connector-java-5.0.4-bin
3.Open a database connection
Á´½Óʱ¿ÉÄܳöÏÖ´íÎó£¬ÄÇôÇë³¢ÊÔÈçÏ·½·¨£º
Err ......