mysqldump导入文件
mysqldump -u root -p test database < /tmp/test.sql
在mysql命令行下load数据
load data infile 'filename' into table tablename
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
mysqldump导入文件
mysqldump -u root -p test database < /tmp/test.sql
在mysql命令行下load数据
load data infile 'filename' into table tablename
<?php | |
if ($_SERVER["HTTP_X_FORWARDED_FOR"]) | |
{ | |
if ($_SERVER["HTTP_CLIENT_IP"]) | |
{ | |
$proxy = $_SERVER["HTTP_CLIENT_IP"]; | |
} else { | |
$proxy = $_SERVER["REMOTE_ADDR"]; | |
} | |
$ip = $_SERVER["HTTP_X_FORWARDED_FOR"]; |
几个概念的厘清: | |
广义单词和狭义单词:狭义单词可以理解为仅仅由数字字母组成的一组字符序列,空格和(),{}等标点符合,回车换行tab等特殊字符都可以分割狭义单词,vim中w按键指的就是狭义单词 | |
广义单词则是两个相邻空格之间的字符序列,vim中按键W就是指广义单词 | |
系统选择缓冲区:所谓系统选择缓冲区是指在*inux系统下,当鼠标选择一部分内容,这部分内容就会被存储在一个位置,该位置就是系统选择缓冲区,vim中 "*调用系统选择缓冲区 | |
使用:reg察看vim中的所有缓冲区,缓冲区的名称是"*或者"+(剪切板缓冲区)或者""(最近操作缓冲区)或者"[0-9a-z] | |
剪切板缓冲区:等同于windows的剪切板,复制,删除,剪切的内容在这个缓冲区存放,vim "+调用该缓存区 | |
如果使用:reg没有 "+和"*缓存区,需要安装vim图形界面,ubuntu下 apt-get install vim-gnome,其他系统请google vim图形界面安装 | |
~ :normal模式下,切换选中单词大小写(toggle case),; | |
常用操作 | |
~ 光标所在位置字符大小写转换 |
"========================================== | |
" Author: wklken | |
" Version: 6 | |
" Email: wklken@yeah.net | |
" BlogPost: http://wklken.me | |
" ReadMe: README.md | |
" Last_modify: 2013-08-04 | |
" Github: " https://github.com/wklken/k-vim | |
" Sections: | |
" ->General 基础设置 |
1 php json_encode | |
假设encode编码的源数据是 : array(1,2,3,4,5,5),那么json_encode的结果是数组 | |
假设encode编码的源数据是:array(1=>1,2=>3),那么json_encode的结果是对象 | |
json_encode默认把关联数组编码为对象 | |
这个细节在和前端js交互传递数据的时候非常重要 |
To start mysqld at boot time you have to copy | |
support-files/mysql.server to the right place for your system | |
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER ! | |
To do so, start the server, then issue the following commands: | |
/usr/local/mysql-5.6.13/bin/mysqladmin -u root password 'new-password' | |
/usr/local/mysql-5.6.13/bin/mysqladmin -u root -h localhost.localdomain password 'new-password' | |
Alternatively you can run: |
#!/bin/sh | |
# | |
# nginx - this script starts and stops the nginx daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /etc/nginx/nginx.conf | |
# config: /etc/sysconfig/nginx |
./configure --prefix=/usr/local\ | |
--conf-path=/usr/local/etc/nginx/\ | |
--user=nginx\ | |
--group=www\ | |
--with-http_ssl_module\ | |
--with-http_realip_module\ | |
--with-http_gunzip_module\ | |
--with-google_perftools_module | |
1 打印前一天时间 | |
<?php | |
echo date("Y-m-d H:i:s", strtotime("-1 days")); | |
?> | |
2 过滤html代码 | |
如果此题单纯值的html代码,则 htmlspecialchars($str),处理输入存储 | |
如果包含用户输入过滤,则sql语句防注入,过滤关键词,使用pdo的时候prepare sql语句 ' 转义 | |
还有和谐社会的关键词过滤(这个非技术而属于政治了) | |
php 原生 Filler 族函数能做相当一部分工作,可在此基础上扩展一个过滤类 |