mysql之连接localhost与127.0.0.1的区别
#!/bin/sh
mysqladmin -S /tmp/mysql3306.sock -p'123456' -r -i 1 ext |\
awk -F"|" \
"BEGIN{ count=0; }"\
'{ if($2 ~ /Variable_name/ && ((++count)%20 == 1)){\
print "----------|---------|--- MySQL Command Status --|----- Innodb row operation ----|-- Buffer Pool Read --";\
print "---Time---|---QPS---|select insert update delete| read inserted updated deleted| logical physical";\
}\
else if ($2 ~ /Queries/){queries=$3;}\
else if ($2 ~ /Com_select /){com_select=$3;}\
else if ($2 ~ /Com_insert /){com_insert=$3;}\
else if ($2 ~ /Com_update /){com_update=$3;}\
else if ($2 ~ /Com_delete /){com_delete=$3;}\
else if ($2 ~ /Innodb_rows_read/){innodb_rows_read=$3;}\
else if ($2 ~ /Innodb_rows_deleted/){innodb_rows_deleted=$3;}\
else if ($2 ~ /Innodb_rows_inserted/){innodb_rows_inserted=$3;}\
else if ($2 ~ /Innodb_rows_updated/){innodb_rows_updated=$3;}\
else if ($2 ~ /Innodb_buffer_pool_read_requests/){innodb_lor=$3;}\
else if ($2 ~ /Innodb_buffer_pool_reads/){innodb_phr=$3;}\
else if ($2 ~ /Uptime / && count >= 2){\
printf(" %s |%9d",strftime("%H:%M:%S"),queries);\
printf("|%6d %6d %6d %6d",com_select,com_insert,com_update,com_delete);\
printf("|%6d %8d %7d %7d",innodb_rows_read,innodb_rows_inserted,innodb_rows_updated,innodb_rows_deleted);\
printf("|%10d %11d\n",innodb_lor,innodb_phr);\
}}'
输出如下显示:
[root@mysql-zst ~]# sh mysql.sh
mysqladmin: [Warning] Using a password on the command line interface can be insecure.
----------|---------|--- MySQL Command Status --|----- Innodb row operation ----|-- Buffer Pool Read --
---Time---|---QPS---|select insert update delete| read inserted updated deleted| logical physical
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
:: | | | |
mysql之连接localhost与127.0.0.1的区别的更多相关文章
- mysql只能连接localhost解决
grant all privileges on *.* to 'root'@'%' identified by 'root';flush privileges;
- mysql不能使用localhost登录
解决mysql不能使用localhost or 127.0.0.1登录 参考:http://soft.chinabyte.com/database/409/12669909.shtml 因为root账 ...
- [日常] 解决mysql localhost可以连接但是127.0.0.1不能连接
在测试mysql的过程中遇到使用localhost可以连接但是127.0.0.1不能连接,原因是localhost使用的本地socket连接,127.0.0.1使用使用的tcp连接 在mysql库的u ...
- linux下使用localhost和127.0.0.1都不能连接的解决思路
linux下刚安装了mysql,尝试写了程序连接mysql,出现了只有用本地ip地址才能连接,而127.0.0.1和localhost都不能访问 解决这个问题主要查看3个方向 .hosts中是否有ip ...
- MySQL主机127.0.0.1与localhost区别总结
1. mysql -h 127.0.0.1 的时候,使用TCP/IP连接, mysql server 认为该连接来自于127.0.0.1或者是"localhost.localdomain&q ...
- MySQL 127.0.0.1和localhost本质区别
登录方式: [root@10-4-14-168 ~]# mysql -uroot -p Enter password: 查看权限表 mysql> SELECT user,host,passwor ...
- mysql开启skip-name-resolve 导致root@127.0.0.1(localhost)访问引发的ERROR 1045 (28000)错误解决方案
为什么配置skip-name-resolve? 由于mysql -h${ip} 远程访问速度过慢, mysql -uroot -p123456 根据网友经验(https://www.cnblogs.c ...
- mysql部署后无法远程连接的原因(错误代码10061),服务监听127.0.0.1和0.0.0.0的区别
在Ubuntu上部署mysql服务并添加了一个非root用户后,发现无法远程连接, Navicat连接mysql出现2003——can't connect to mysql server on loc ...
- CentOS下php使用127.0.0.1不能连接mysql的解决方法
这篇文章主要介绍了CentOS下php使用127.0.0.1不能连接mysql的解决方法,本文原因是SELINUX导致的连接失败,需要的朋友可以参考下 php代码很简单: 复制代码代码如下: $ser ...
随机推荐
- 在asp.net中使用ajax记录
一.问题描述 ajax在mvc中使用频繁,比如cms中的评论功能,但由于涉及到前后端开发,日久容易忘,在此做下记录. 二.内容 控制器中代码示例: /// <summary> /// 在文 ...
- iOS 之 Swift 新特性
支持所有C和OC的基本类型 提供了Array 和Dictionary两个强劲的集合类型 元组 可选类型 闭包 脚本特性 类型安全
- Assembly
Principles of Computer Organization and Assembly Language Using the JavaTM Virtual Machine http://it ...
- webpack之代码分离
https://robertknight.github.io/posts/webpack-dll-plugins/ webpack一般会把一个文件里import/require的文件都会打包在一起,最 ...
- ubuntu修改环境变量
1.修改/etc/profile后重启之后就失效了,需要修改/etc/environment才可以 以下情况是失败的: 在/etc/profile文件中添加变量[对所有用户生效(永久的)] 用VI在文 ...
- @RequestBody和@ResponseBody
@RequestBody 将HTTP请求正文转换为适合的HttpMessageConverter对象. @ResponseBody 将内容或对象作为 HTTP 响应正文返回,并调用适合HttpMess ...
- emmet学习笔记
Emment语法使用:按table键的结果1.初始化:(HTML文档需要包含一些固定的标签,比如<html>.<head>.<body>等). html:或! :用 ...
- Myeclipse8.5 反编译插件 jad 安装(转)
准备工作 下载jad.exe文件:http://www.varaneckas.com/sites/default/files/jad/jad158g.win.zip 下载jadeclipse插件:ht ...
- 汇编实现HelloWorl!
hello word~ ASSUME CS:CODE,DS:DATA DATA SEGMENT DB "HELLO WORLD" ;存储要显示的数据 DATA ENDS CODE ...
- [html5]学习笔记一 新增的非主体结构元素
html新增加的非主体结构元素,主要是用来表示附加信息的,包括header,footer,hgroup,address元素. 1.header元素 header元素是一种具有引导和导航作用的结构元素, ...