此贴是MySQL相关的东西
MySQL管理工具:
PhpMyAdmin
SQLyog
mysql front
EMS SQL Manager
mysqlAdministrator
mysqlquery
mysqlcc
Navicat for MySQL
改变mysql的提示符:
在my.cnf中加入下面的
1)
[mysql]
prompt=\\U:\\d >
然后提示符会变为
14:53:38>
2)prompt=\\U:\\d \\D>
然后提示符会变为
) Fri Sep 4 15:00:33 2009>exit
3)
[mysql]
#tee=/tmp/myaction.log
pager=more
查看mysql是静态还是动态
-bash-3.1# file /usr/libexec/mysqld
/usr/libexec/mysqld: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), for GNU/Linux 2.6.9, stripped
mysql常用的工具:
MySQL JDBC驱动负载均衡
MySQL JDBC驱动中可以通过“jdbc:mysql:loadbalance://sqlnode1,sqlnode2,…sqlnoden/database?loadBalanceBlacklistTimeout=3000” 连接 MySQL Cluster 做负载均衡
BENCHMARK() 函数重复count 次执行表达式 expr 。 它可以被用于计算 MySQL 处理表达式的速度。结果值通常为 0。另一种用处来自 mysql客户端内部,能够报告问询执行的次数:
mysql> SELECT BENCHMARK(1000000,ENCODE( 'hello ', 'goodbye '));
+----------------------------------------------+
¦ BENCHMARK(1000000,ENCODE( 'hello ', 'goodbye ')) ¦
+----------------------------------------------+
¦ 0 ¦
+----------------------------------------------+
1 row in set (4.74 sec)
此处报告的时间是客户端上的共用时间,而不是服务器端上的CPU时间。建议执行多遍BENCHMARK(),并解释与服务器机器负荷程度有关的结果。
表之间到数据:
SET @@AUTOCOMMIT=0;
LOCK TABLES yyy WRITE, xxx READ;
insert into yyy select * from xxx ;
UNLOCK TABLES;
1) 怎么记录客户端对数据库的所有操作?
added log=/tmp/logfile in /etc/my.cnf
This includes access/read/update connections, disconnections and executed SQL statements
参考:
)看TPS
找了公式,写了条语句:
TPS(每秒事务量)
TPS = (Com_commit + Com_rollback) / seconds
use information_schema;
select variable_value into @num_com from global_status where variable_name ='COM_COMMIT';
select variable_value into @num_roll from global_status where variable_name ='COM_ROLLBACK';
select variable_value into @uptime from global_status where variable_name ='uptime';
select (@num_com+@num_roll)/@uptime;
INNODB
配置innodb_file_per_table参数后,每个表单独一个.ibd文件 |
阅读(1412) | 评论(0) | 转发(0) |