MYSQL已经生效的设置和状态查询命令
以下命令可以在任何已经连接上MYSQL服务器的客户端上执行。
show full processlist ;
kill 57725;#杀掉上面查到的某个导致阻塞的连接
SELECT @@profiling;
SET profiling = 1;
SHOW PROFILES;
SHOW PROFILE for QUERY 1;
#系统设置
show variables like '%key%';
show variables like '%key%';
show variables like '%max%';
show variables like '%char%';
show variables like '%coll%';
show variables like '%buffer%';
#运行状态
show status like '%thread%';
show status like 'Qcache%';
show status like 'Open%tables';
show status like '%lock%';
show status like '%key%';
show status like '%buffer%';
show global status ;
show master status;
show slave status;
show slave hosts;
show binlog events;
相关文档:
最近公司准备使用项目管理的网站DotProject,公司虽然不大,但是牵涉到的业务也是很复杂的,所以需要定时去保存数据库的信息以防止数据库崩溃或者其他的原因造成的数据损失,这样就需要进行数据库的备份。
DotProject使用的是Mysql数据库,备份Mysql数据库的一个比较好的方法就是 ......
分页功能在任何应用中都比较常见,而
Mysql
的存储过程分页必须通过动态
sql
来执行。分页对应的
offset
和
row_count
必须先用
concat
函数变成字符串组装到
sql
中(如语句
1
),而不能直接使用(如语句
2
,
Mysql
不支持)。
Mysql
分页功能的实现如下代码所示:
&nbs ......
/* CSS Document */
body {
font: normal 11px auto "Trebuchet MS", verdana, arial, helvetica, sans-serif;
color: #4f6b72;
background: #e6eae9;
}
a {
color: #c75f3e;
}
table{
padding: 0;
margin: 0;
border-left: 1px solid #c1dad7;
}
caption { ......
MySQL优化
同时在线访问量继续增大,对于1G内存的服务器明显感觉到吃力严重时甚至每天都会死机,或者时不时的服务器卡一下,这个问题曾经困扰了我半个多月。MySQL使用是很具伸缩性的算法,因此你通常能用很少的内存运行或给MySQL更多的被存以得到更好的性能。
安装好mysql后,配制文件应该在/usr/local/mysql/share/mysql ......