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的服务经常发现1067这个错误。查看事件日志以后发现下面的错误信息
Unknown/unsupported table type: INNODB
如何解决:在mysql数据存放目录下找到 ibdata 以及ib_logfile0、ib_logfile1删掉再启动就好了 ......
版权声明
:转载时请以超链接形式标明文章原始出处和作者信息及本声明
http://bbayou.blogbus.com/logs/37045617.html
测试数据2.5G,共有数据9427567条。用的mysql的large服务器的配置。
load
一次需要大概10分钟左右。
建的表用的是MYISAM,调整了几个session的参数值
SET
SESSION
BULK_INSERT_BUFFER_S ......
1、MySQL是有一些环境变量可以设置,
可输入:show variables;可查看当前的环境变量设置;
2、这些变量当中有一部分与字符相关的设置,
可输入:show variables like ´character%´;查看;
3、其中character_set_results决定返回结果的编码,
windows下设为gb2312即可正常显示中文;
设置方法:set charac ......
编译安装
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 ......
这是随机选择A0-A3四组数据中其中一组PHP代码:
<?php
$A[0]="QQ:<font color=ff32000>7161283</font>";
$A[1]="E_mail:<font color=ff32000>15018499772@139.com</font>";
$A[2]="手机:<font color=ff32000>15018499772</font>";
$A[3]="MSN:<font color=ff32000>chinaa ......