MYSQL 备忘录
MySQL client programs:
mysql
The command-line tool for interactively entering SQL statements or executing them from a file in batch mode. See Section 4.5.1, “mysql — The MySQL Command-Line Tool”.
mysqladmin
A client that performs administrative operations, such as creating or dropping databases, reloading the grant tables, flushing tables to disk, and reopening log files. mysqladmin can also be used to retrieve version, process, and status information from the server. See Section 4.5.2, “mysqladmin — Client for Administering a MySQL Server”.
mysqlcheck
A table-maintenance client that checks, repairs, analyzes, and optimizes tables. See Section 4.5.3, “mysqlcheck — A Table Maintenance and Repair Program”.
mysqldump
A client that dumps a MySQL database into a file as SQL, text, or XML. See Section 4.5.4, “mysqldump — A Database Backup Program”.
mysqlimport
A client that imports text files into their respective tables using LOAD DATA INFILE. See Section 4.5.5, “mysqlimport — A Data Import Program”.
mysqlshow
A client that displays information about databases, tables, columns, and indexes. See Section 4.5.6, “mysqlshow — Display Database, Table, and Column Information”.
mysqlslap
A client that is designed to emulate client load for a MySQL server and report the timing of each stage. It works as if multiple clients are accessing the server. See Section 4.5.7, “mysqlslap — Load Emulation Client”.
相关文档:
***function(/*常用函数*/)***
----统计函数----
AVG --求平均值
COUNT --统计数目
MAX --求最大值
MIN --求最小值
SUM --求和
--AVG
use pangu
select avg(e_wage) as dept_avgWage
from employee
group by dept_id
--M ......
Transact_SQL小手册
*******************Transact_SQL********************
--语 句 功 能
--数据操作
SELECT & ......
1、编辑MySQL配置文件:
windows环境中:%MySQL_installdir%\my.ini //一般在MySQL安装目录下有my.ini即MySQL的配置文件。
linux环境中:/etc/my.cnf
在[MySQLd]配置段添加如下一行:
skip-grant-tables
保存退出编辑。
2、然后重启MySQL服务
windows环境中:
net stop MySQL
net start MySQL
linux环境中 ......
http://javeye.javaeye.com/blog/558093
我们知道,group by可以将sql查询结果按照group by后面列进行分类显示。比如:
Sql代码
select
columnA,columnB
from
table
group
by
columnA,columnB
select columnA,columnB from table group by columnA,colum ......
最近了解了一下MYSQL注入,也实际操作了一下,确实发现了他的威力。
一个注入漏洞可以让人直接拿到服务器权限。
总结一下:
1,目录的权限不能太高,不然别人能往里写文件,以前用0777真是太愚蠢了。
2,严格过滤数据,整形一律转int或用mysql_escape_string
3,设置合理的数据库权限,不要用ROOT,不然会死得很惨。
4 ......