- 博客(5)
- 收藏
- 关注
原创 mariadb主从复制
1,准备两台服务器 一台设置为master服务器,一台设置为slave服务器,两台服务器先关闭防火墙,关闭selinux。 systemctl stop firewalld setenforce 0 两台服务器都需要安装mariadb(这里用yum安装,yum需要提前配置好) yum -y install mariadb-server mariadb 2,配置master服务器 启动binlog日志 vim /etc/my.cnf.d/server.cnf 配置完成后起服务 s.
2022-03-23 15:16:18 1335 1
原创 yum脚本一键配置
#!/bin/bash if [ ! -d /etc/yum.repos.d/repo ];then mkdir /etc/yum.repos.d/repo &> /dev/null fi mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/repo cat>/etc/yum.repos.d/dvd.repo<<EOF [dvd] name=dvd enabled=1 gpgcheck=0 baseurl=file:///m...
2022-03-11 16:45:23 2077
原创 mysql大全
create database school; 创建名字为school的数据库 show databases; 查看有哪些数据库 use school; 切换到school库里 create table student( 建表 -> id int primary key auto_increment, primary key 是主键,auto_increment是自动增长 -...
2022-03-10 14:57:46 759
原创 mysql数学函数
select abs(-5); 绝对值 select sqrt(9); 开平方 select format(1234.456,2); 表示格式化并保留后两位 select mod(10,3); 取余数 select ceil(1.3); 向上取整数 select floor(2.9); 向下取整数 select rand(); 生成随机数字(数字不一样) ...
2022-03-10 14:03:11 536
原创 mysql中的函数
select concat('hello','world'); 字符串拼接 select length('helloworld'); 显示字符长度 select trim(' hello '); 去除空格 select ltrim(' hello '); 去除左边空格 select rtrim(' hello '); 去除右边空格 select ...
2022-03-10 09:45:33 681 3
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人