1、统计某一个库中各表空间占用多少MB
use information_schema;
SELECT TABLE_NAME,
CONCAT(TRUNCATE(DATA_LENGTH / 1024 / 1024, 2), ' mb') AS DATA_SIZE,
CONCAT(TRUNCATE(INDEX_LENGTH / 1024 / 1024, 2), ' mb') AS INDEX_SIZE
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'zabbix'
GROUP BY TABLE_NAME
ORDER BY DATA_LENGTH DESC;
阅读全文…
1 下载mysql源码包
在mysql网站,左边选MySql Community Server,选带boost的版本
“Select Version”选版本,Select Platform选”Source Code”,然后选”Generic Linux”
阅读全文…
1 修改配置文件
vim /etc/my.cnf
在[mysqld]节点添加
skip-grant-tables
2 重启mysql
3 用空密码进入
mysql -uroot
执行:
update mysql.user set authentication_string=password(‘MyNewPass’) where user=’root’ and Host = ‘localhost’;
flush privileges;
退出mysql
4 后续工作
还原my.cnf
以root登陆后再次执行如下命令
ALTER USER ‘root’@’localhost’ IDENTIFIED BY ‘MyNewPass’;
1 下载mysql源码包
我用的是5.6.28的版本
下载地址:http://dev.mysql.com/downloads/mysql/5.6.html#downloads
“Select Version”选版本,Select Platform选”Source Code”,然后选”Generic Linux ”
2 安装依赖组件
如果可以yum install就容易了
1)make编译器
下载地址:http://www.gnu.org/software/make/
2)bison
下载地址:http://www.gnu.org/software/bison/
3)gcc-c++
下载地址:http://www.gnu.org/software/gcc/
4)cmake
下载地址:http://www.cmake.org/
5)ncurses,ncurses-devel
下载地址:http://www.gnu.org/software/ncurses/
阅读全文…
近期评论