数据最近总是莫名的挂掉,查看了一下mysql日志,提示[Warning] IP address ‘xxxx’ could not be resolved: Name or service not known,是因为mysql默认会反向解析DNS,对于访问者Mysql不会判断是hosts还是ip都会进行dns反向解析,频繁地查询数据库和……继续阅读 »
往事如烟
5年前 (2020-04-10) 5282浏览 0评论
1个赞
公司最近需要恢复一批Mysql备份数据,对mysql和解压工具版本要求较高,整理了一下安装Mysql5.6的详细步骤,方便下次查询。
准备工作
删除系统自带的mariadb,安装mysql。
[root@localhost ~]# rpm -qa | grep mariadb
mariadb-libs-5.5.44-2.el7.centos.x86_……继续阅读 »
往事如烟
5年前 (2020-03-27) 2342浏览 0评论
0个赞
1290 – The MySQL server is running with the –secure-file-priv option so it cannot execute this statement
secure-file-priv特性
secure-file-priv参数是用来限制LOAD DATA, SELECT &……继续阅读 »
往事如烟
5年前 (2019-12-16) 2176浏览 0评论
0个赞
主要是权限不足造成,使用口令查询Mysql是否开启导出功能,并查看数据路径,在对应路径下导出数据:
mysql> show variables like '%secure%';
+------------------+----------------------------+
| Variable_name | Value……继续阅读 »
往事如烟
5年前 (2019-12-11) 2269浏览 0评论
0个赞
1、查看最大连接数
mysql> show variables like "%max_connections%";
±----------------±------+
| Variable_name | Value|
±----------------±------+
| max_connections| 141 |
……继续阅读 »
往事如烟
5年前 (2019-12-11) 2318浏览 0评论
0个赞
shell声明集合的方式:
赋值:
array[0]="1"
array[1]="2"
array[2]="3"
小括号
array=( 1 2 3 )
引号
array="1 2 3"
引号+括号
array=([0]="1"……继续阅读 »
往事如烟
6年前 (2019-11-25) 2293浏览 0评论
1个赞
兼容性问题,因为linux将sh默认指向了dash,而不是bash 。
解决方法:
不在使用sh来启动脚本,使用bash来启动sh脚本,如: bash test.sh
在root下面执行 dpkg-reconfigure dash,选择no,删除dash指向并添加bash指向
……继续阅读 »
往事如烟
6年前 (2019-11-25) 2293浏览 0评论
0个赞
crontab每分钟定时执行:
*/1 * * * * service mysqld restart //每隔1分钟执行一次
*/10 * * * * service mysqld restart //每隔10分钟执行一次
crontab每小时定时执行:
0 */1 * * * service mysqld restart //每1小时执行一次……继续阅读 »
往事如烟
6年前 (2019-11-25) 2279浏览 0评论
0个赞
Linux下安装apache相对比较简单,使用yum直接安装即可。
检查是否已经安装apache
# yum list installed | grep httpd
直接安装apache服务器,安装后,默认端口80。
# yum install httpd httpd-devel -y
安装完成后,修改默认端口
vim /etc/httpd/conf……继续阅读 »
往事如烟
6年前 (2019-11-24) 2288浏览 0评论
0个赞
下面是CentOS5 和7的口令,略有不同。
1:查看防火状态
systemctl status firewalld
service iptables status
2:暂时关闭防火墙
systemctl stop firewalld
service iptables stop
3:永久关闭防火墙
systemctl disable firew……继续阅读 »
往事如烟
6年前 (2019-11-24) 2340浏览 0评论
0个赞
启动mysql:
方式一:sudo /etc/init.d/mysql start
方式二:sudo service mysql start
停止mysql:
方式一:sudo /etc/init.d/mysql stop
方式二:sudo service mysql stop
重启mysql:
方式一:sudo/etc/init.……继续阅读 »
往事如烟
6年前 (2019-11-22) 2424浏览 0评论
0个赞
Linux下新建的mysql数据,进入mysql的时候,看不到mysql库,一般都是因为当前用户权限不足造成的。下面记录下自己的解决办法。
系统:CentOS 5.6、Mysql Server version: 5.1.71
解决方法
登录mysql后,因权限不足,看不到mysql库。
[root@hadoop001 ~]# mysql -uroot
We……继续阅读 »
往事如烟
7年前 (2018-07-22) 3115浏览 0评论
0个赞