修改mysql 数据文件目录

分类:技术文档 - MySQL | 阅读(1600) | 发布于:2013-07-28 14:25 | 标签: mysql

 MySQL目录的更改,首先需要停掉mysql服务器/etc/init.d/mysql stop,
下面新目录以/data/mysql/ 为例,然后cp -R /usr/local/mysql/var/* /data/mysql/,
再chown mysql:mysql -R /data/mysql/ 
下面再修改/etc/my.cnf ,
查找[mysqld] ,
在下面加入datadir = /data/mysql/ 
保存,启动mysql。

阅读更多...

curl获取IP地址,

分类:技术文档 - PHP文档 | 阅读(1999) | 发布于:2013-07-27 13:04 | 标签:无

	
function mycurl($date){
		if(!$date['url']){die('未给定URL参数.');}
		$ch = curl_init($date['url']);
		curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0; KB974487)');
		curl_setopt($ch, CURLOPT_HEADER, 0);
		curl_setopt($ch, CURLOPT_TIMEOUT, TIMEOUT);
		curl_setopt($ch, CURLOPT_AUTOREFERER,true);
		if( $date['referer']){curl_setopt($ch, CURLOPT_REFERER, $date['referer']);}
		curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
		curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
		curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 0);
		curl_setopt($ch, CURLOPT_ENCODING, ' gzip, deflate');
		if($date['header']){curl_setopt($ch, CURLOPT_HTTPHEADER, $date['header']);}
		if($date['cookie_file']){curl_setopt($ch, CURLOPT_COOKIEFILE, $date['cookie_file'] );curl_setopt($ch, CURLOPT_COOKIEJAR,  $date['cookie_file'] );}
		if($date['cookie_str']){curl_setopt($ch, CURLOPT_COOKIE,  $date['cookie_str'] );}
		if($date['post_date']){	curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($date['post_date']));}
		if($date['post_date_arr']){curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $date['post_date_arr'] );}
		curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
		curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1);
		$cons = curl_exec($ch);
		curl_close($ch);
		return $cons;
	}

	function getIP(){
		$html =  mycurl(array(
			'url'=>'http://www.baidu.com/baidu?wd=ip',
		));
		if(preg_match('/

(.*?)

/s',$html,$mh)){ return $mh[1]; }else{ return '本机IP获取失败'; } }

阅读更多...

世界,你好!

分类:散文阅读 | 阅读(1865) | 发布于:2013-07-27 04:54 | 标签:无

欢迎使用 WordPress。这是系统自动生成的演示文章。编辑或者删除它,然后开始您的博客!


$.ajax({
	url: document_url,
	dataType : 'json',
	processData: false,
	type: 'POST',
	contentType: content_type,
	data: the_command,
	context: response_element,
	beforeSend: function (xhr, settings) {
		
	},
	success: function (response, text_status, xhr) {
		
	},
	error: function (xhr, text_status, error_thrown) {
		
	},
	complete: function (xhr, text_status) {
		
	}
});

<head>
	<title>文章编辑 - </title>
	<link rel="stylesheet" href="http://icon.lixiaocheng.com/blog/css/postEdit.css" />
		KindEditor.ready(function(K) {
			var editor = K.create('textarea.postCons', {
				allowFileManager : true,
			});
		});
	</script>
</head>

阅读更多...