mysql

docker-compose 快速搭建Mysql主从

目录结构 ├── docker-compose.yml ├── master │   ├── conf │   │   └── my.cnf │   └── log ├── phpmyadmin │   ├── config.user.inc.php │   └── readme.md ├── readme.md └── slave ├── conf │   └── my.cnf └── log 启动服务 docker-compose up -d 进入master服务器 docker exec -it docker-mysql-master bash #登录mys...

解决 mysql8 报错 this is incompatible with sql_mode = only_full_group_by

报错内容 Error Code: 1055. Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column '{field}' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by 0.053 sec 确认运行模式 mysql> select @@global.sql_mode; ONLY...

mysql常用语句

增删改查 -- 查询 SELECT `title`, `content` FROM `article` WHERE `id` > 0; -- 新增 INSERT INTO `article`(`title`, `content`) VALUES('ttt','ccc'); INSERT INTO `article` VALUES(1, 'ttt','ccc');#省略字段名 INSERT INTO `article` (`title`, `content`) VALUES('ttt','ccc'), ('ttt2','ccc2');#批量插入 INSERT INTO `article` SE...

mariadb(mysql) 安装与使用,备份及恢复

#为什么选择mariadb 前提是开发环境。mariadb体积小,安装方便,兼容常用mysql指令 安装 #Server version: 5.5.68-MariaDB MariaDB Server yum install mariadb-server 开机自启 systemctl enable mariadb 常用命令 systemctl start mariadb ️启动MariaDB systemctl stop mariadb ️停止MariaDB systemctl restart mariadb ️重启MariaDB 开发环境设置root账号以任意ip,空密码登陆 #...