DML(Data Manipulation Language,数据操纵语言): insert update deleteDDL(Data Definition Language,数据定义语言):create alter drop DCL(Data Control Language,数据控制语言):grant revokeTCL(Transaction Control Lang
CentOS 7部署TIDB单机:curl --proto '=https' --tlsv1.2 -sSf https://tiup-mirrors.pingcap.com/install.sh | shsource /root/.bash_profilevi topo.yaml (将10.0.1.1改为实际ip,单ip为单机,多ip即为集群)# Global variables are app
myql搭建mha高可用:注: 本质是主从+高可用保障(1个mha管理节点,1个mysql主节点,1个mysql从节点)下载网址: https://code.google.com/archive/p/mysql-master-ha/downloads (mha4mysql-manager-0.55.tar.gz)安装:mha manager(manager上也需要安装node软件):rp
Mysql主主模式搭建:注: 1、互相指定对方为master 2、半同步复制 3、keepalived搭建HA(vip在哪台哪台为master) 4、10.0.0.2是mha manager ip,10.0.0.3、10.0.0.4是mysql node ip,10.0.0.5是vipmysql安装略互为主从(2台同样操作):mysql -u root -p输入密码grant REPLICATIO
web服务器连接mysql频繁报can’t connect 99错误解决一、现象:web服务器页面提示can’t connect to MySQL server on ‘xxx.xxx.xxx.xxx’ (99)二、分析:99报错代码一般表示无法分配本地地址资源(应该是端口),socket无法创建在web服务器上执行netstat –anp | grep 自己ip | wc –l看到有20461个
限制mysql临时表ibtmp1文件大小:vi /etc/my.cnf (只能改my.cnf文件重启生效,不支持mysql会话里set global操作)innodb_temp_data_file_path = ibtmp1:12M:autoextend:max:500G:wqsystemctl restart mysql查看:mysql -u root -p输入密码show variables
mysql报错ssl connection error解决办法:vi /etc/my.cnfskip_ssl:wqsystemctl restart mysqld
导出mysql库中账号信息:注:该命令不受mysql版本限制,可用于mysql大版本升级时的账号权限导出、导入,比如5.6升5.7通过mysqldump会报错mysql -u root -p'xxxxx' -e 'select user,host from mysql.user'| grep -v "mysql.sys"| grep -v root| awk '{print "sh
Ubuntu20.04搭建postgresql13主从 postgresql主服务器(10.0.0.2):apt-get install postgresql-13mkdir /space/postgresqldbsystemctl stop postgresqlrsync -av --progress /var/lib/postgresql/13/main /space/postgresql/
从postgresql报错cloud not receive data from WAL stream解决办法:从:systemctl stop postgresqlmv /space/postgresqldb/main /space/postgresqldb/main.bakmkdir /space/postgresqldb/mainchown postgres:postgres /space/
#!/bin/bash Date=`date +%Y%m%d` Date2=`date +%Y%m%d -d "90 days ago"` /bin/mkdir -p /log/mysql /bin/mkdir -p /backup/aa01db/$Date /usr/bin/mysql -u sqlbak -p'xxxxx' -e "show databases;" | grep -v "Dat
CentOS7.9安装Mysql5.7:yum remove mariadb-libsyum install perl-JSONcd /space/setup/tar xfv mysql-5.7.26-1.el7.x86_64.rpm-bundle.tarrpm -i /space/setup/mysql5.7/rpm/mysql-community-common-5.7.26-1.el7.x86
Mysql几种数据格式:1、.idb:存放innodb数据的文件2、.frm:存放表结构的文件3、.MYD:MyiSAM存储引擎数据的文件4、.MYI:MyiSAM存储引擎索引文件
修改mysql log时区:命令:set global log_timestamps=SYSTEM;配置文件:vi /etc/my.cnflog_timestamps=SYSTEM:wq
mysql 8.0修改密命令:alter user 'aa'@'xxx' identified with mysql_native_password by 'xxxx';报错SSL connection error: unknown error number:解决:在my.cnf里添加skip_ssl备份权限(比之前版本多了个process):grant select,reload,process
mysql5.7
Ubuntu20.04搭建postgresql12主从postgresql主服务器(10.0.0.2): # apt-get install postgresql # mkdir /space/postgresqldb # systemctl stop postgresql # rsync –av –progress /var/lib/postgresql/12/main /space/postg
LVS+keepalived做Mysql集群的负载均衡:注:1、LVS本身不对node做健康检查的,所以要借助keepalived2、根据配置当某nodedown掉会有几秒判断时间,这点请注意。负载均衡端:yuminstallipvsadmkeepalivedipset-devel注:keepalived的log在/var/log/message里vi/etc/keepalived/keepali
Maxscale实现Mysql读写分离:注:1、该工具只有一主,如主出了问题整体会有10s左右不可用(即使从会自动切为主)。2、读设置的2台实际只生效了1台。下载地址:https://mariadb.com/downloads/#mariadb_platform-mariadb_maxscalerpm-imaxscale-2.4.9-1.centos.7.x86_64.rpmvi/etc/maxs
CentOS7搭建GaleraCluster(5.7):rpm下载网址:http://galeracluster.com/downloads/第1台:安装:yuminstallperlnet-toolslsofsocatperl-JSONperl-Data-Dumperlibaioopenssl-develrpm-epostfixrpm-U/space/setup/5.7/mysql-wsrep-
Atlas做mysql读写分离:Atlas奇虎360的一个开源中间代理,是在mysql-proxy0.8.2的基础上进行了优化,增加一些新的功能特性。wgethttps://github.com/Qihoo360/Atlas/releases/download/2.2.1/Atlas-2.2.1.el6.x86_64.rpmrpm-iAtlas-2.2.1.el6.x86_64.rpm安装路径为/
proxySQL做mysql读写分离:参考网址:https://cloud.tencent.com/developer/article/1429052下载网址:http://repo.proxysql.com/ProxySQL/proxysql-2.0.x/centos/6/proxysql-2.0.8-1-centos67.x86_64.rpm官方网址:https://www.proxysql.
CentOS6.8搭建mysql-proxy实现读写分离:下载网址:http://ftp.ntu.edu.tw/MySQL/Downloads/MySQL-Proxy注:1、10.0.1.2为mysql-proxy服务器ip2、效果是1个写,2个读tarzxfvmysql-proxy-0.8.5-linux-el6-x86-64bit.tar.gz-C/spacemv/space/mysql-pr
mycat多个库:vi/space/mycat/conf/schema.xml<?xmlversion="1.0"?><!DOCTYPEmycat:schemaSYSTEM"schema.dtd"><mycat:schemaxmlns:mycat="http://io.mycat/"><schem
Mysqlmycat读写分离:下载网址:http://dl.mycat.ioMycat官方网址:http://mycat.org.cn说明:10.0.1.2为mycat服务器,10.0.1.3、10.0.1.4为mysql服务器yuminstalljava-1.8.0-openjdktarzxfvMycat-server-1.6.7.5-test-20200109231555-linux.tar.
GelaraLoadBalancer做负载均衡:安装:yuminstallgitlibtoolgcc-c++gitclonehttps://github.com/codership/glbcdglb/./bootstrap.shmake&&makeinstallcp-rvfiles/glbd.sh/etc/init.d/glbcp-rvfiles/glbd.cfg/etc/sysc
pt-heartbeat监测mysql主从同步延迟:安装perconatoolkit(pt-heartbeat为该软件的子命令):http://repo.percona.com/release/6/RPMS/x86_64/percona-toolkit-3.0.13-1.el6.x86_64.rpmyuminstallperl-DBD-MySQLyuminstallperl-IO-Socket-S
sysbench测试mysql性能:安装sysbench0.5:apt-getinstallbzrautomakelibtoollibmysqlclient-devln-s/usr/lib/x86_64-linux-gnu/libmysqlclient.so.20.3.14/usr/lib/libmysqlclient_r.sobzrbranchlp:sysbenchcdsysbench/./au
解决mysql中文乱码:注:通过SQL语句调整不起作用的,只能重启mysql生效vi/etc/my.cnf[mysqld]character-set-server=utf8[client]default-character-set=utf8[mysql]default-character-set=utf8:wqservicemysqlrestart
设置mysql不区分大小写:注:这个参数没办法通过sql语句改的,只能重启mysql生效vi/etc/my.cnf[mysqld]lower_case_table_names=1:wqservicemysqlrestart
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号