易截截图软件、单文件、免安装、纯绿色、仅160KB

php mysql_connect 与mysql_pconnect函数与实例教程

php教程 mysql教程_connect 与mysql_pconnect函数与实例教程
mysql_connect
 mysql_connect($this->root,$this->user,$this->pass)
/*
mysql_connect ,单个反问用户不会频繁的调用数据库教程,没必要保持连接,而且mysql的连接数也是有限制的, 使用 及时访问比较频繁,也最好使用mysql_connect,这样使用的过的资源可以立刻释放,否则,容易造成资源耗
*/
mysql_pconnect
/*
mysql_pconnect() 函数打开一个到 MySQL 服务器的持久连接
*/
$con = mysql_pconnect("localhost","mysql_user","mysql_pwd");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
 
class testLinkMysql{ 
  public $conn;
  public $root='localhost';
  public $user='root';//'loupan';
  public $pass='root';//'loupandsffds';
  public $db='dbname';
  public $charset='gbk';
  public $links='c'; //标题
  
  function __construct() {
    if( !$this->conn )
   {
    $this->connect();
   }   
  }
  
    
  function __destruct() {
   if( $this->conn )
   {
          $this->close();
   }
     }
  
  
  function MysqlConnect()
  {
   try{
    if( 'p' == $this->links )
    {
     $this->conn = mysql_pconnect($this->root,$this->user,$this->pass) or die(mysql_error());       
    }
    else
    {
     $this->conn = mysql_connect($this->root,$this->user,$this->pass) or die( mysql_error());
    }
    mysql_select_db($t


相关文档:

如何提高mysql load data infile的速度


版权声明
:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://bbayou.blogbus.com/logs/37045617.html
测试数据2.5G,共有数据9427567条。用的mysql的large服务器的配置。
load
一次需要大概10分钟左右。
建的表用的是MYISAM,调整了几个session的参数值
SET

SESSION

BULK_INSERT_BUFFER_S ......

cmd命令提示行连接mysql乱码的解决

1、MySQL是有一些环境变量可以设置,
可输入:show variables;可查看当前的环境变量设置;
2、这些变量当中有一部分与字符相关的设置,
可输入:show variables like ´character%´;查看;
3、其中character_set_results决定返回结果的编码,
windows下设为gb2312即可正常显示中文;
设置方法:set charac ......

一个 mysql server 上的小技巧

转自http://www.linuxbyte.org/yi-ge-mysql-server-shang-de-xiao-ji-qiao.html
在my.cnf 的 mysql 端 添加如下设置
[mysql]
#no-auto-rehash # faster start of mysql but no tab completition
prompt="(\u:mysql1@linuxbyte.org \R:\m)[\d]: "
会产生如下效果:
root@ubuntu:/home/hew# mysql -u hew -p
Enter pass ......

fedora下php环境配置

编译安装
apache
下载apache安装
=============================
我把他安装在/usr/local/apache目录下
tar -zxvf apache文件
进入解压后的目录,配置./configure --prefix=/usr/local/apache -enable-mods-shared=all -enable-so -enable-rewrite
make
make install
然后启动/usr/local/apache/bin/apachectl sta ......

Month of PHP Security Summary

it is 21th of May. The Month of PHP Security
(http://www.php-security.org) is still running and we have reached a
vulnerability count of 40 vulnerabilities, which is nearly as much as we
disclosed during the whole Month of PHP Bugs in 2007. However there are
11 more days until the end of May and ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号