mariadb

mysql主从复制

大兔子大兔子 提交于 2020-01-26 23:59:14
文章目录 mysql 主服务器配置 mysql 从服务器配置 不小心在从服务器上作了配置 添加一台从服务器 主服务器发生意外宕机了,提升一台从为主服务器 mysql 主服务器配置 yum install mariadb-server -y vim /etc/my.cnf [ mysqld ] server_id = 7 log_bin = /data/logbin/mariadb-bin mkdir /data/logbin chown -R mysql.mysql /data/logbin systemctl start mariadb mysql < hellodb_innodb.sql mysql MariaDB [ ( none ) ] > grant replication slave on *.* to 'replicationuser' @ '192.168.43.%' identified by 'centos' ; mysqldump -A -F --single-transaction --master-data = 1 -q > /data/all.sql scp /data/all.sql 192.168.43.17:/data/ mysql 从服务器配置 yum install mariadb-server -y vim /etc/my.cnf [

2020.1.26 CentOS 7配置mariadb

丶灬走出姿态 提交于 2020-01-26 20:00:00
完全删除mysql残留 yum remove mariadb rm -f /etc/my.cnf rm -rf /var/lib/mysql 安装mariadb yum install -y mariadb-server systemctl start mariadb systemctl enable mariadb 设置root账户密码 mysqladmin -u root -p password < 密码 > 初始没有密码就直接回车 以root身份登录 配置权限 GRANT ALL PRIVILEGES ON * . * TO 'root' @' % ' IDENTIFIED BY ' < 密码 > ' WITH GRANT OPTION ; FLUSH PRIVILEGES ; 创建用于登陆的用户,并且赋予全部权限 CREATE USER dzzhyk IDENTIFIED BY '<密码>' ; GRANT ALL PRIVILEGES ON * . * TO 'dzzhyk' @' % ' IDENTIFIED BY ' < 密码 > WITH GRANT OPTION ; FLUSH PRIVILEGES ; 删除用户 DROP USER < name > ; 更改用户的密码 UPDATE mysql . user SET password = password (

How to forcefully remove MySQL and MariaDB from Ubuntu 16.04, without `apt-get` and `dpkg`?

◇◆丶佛笑我妖孽 提交于 2020-01-26 04:05:42
问题 By wrong uninstalling MariaDB , I've lost working instance of MySQL and MariaDB in my Ubuntu 16.04 system... I've broken the dependencies so much, that I can not uninstall or install MySQL or MariaDB , using apt-get , or dpkg ... All the following commands failed: apt-get [install -f] [update] [remove] [purge] [autorove] [clean] [check] and options with dpkg such as: dpkg --remove --force-remove-reinstreq mysql also don't help me. Manually downloading the package and attempting to install

How to forcefully remove MySQL and MariaDB from Ubuntu 16.04, without `apt-get` and `dpkg`?

我是研究僧i 提交于 2020-01-26 04:05:07
问题 By wrong uninstalling MariaDB , I've lost working instance of MySQL and MariaDB in my Ubuntu 16.04 system... I've broken the dependencies so much, that I can not uninstall or install MySQL or MariaDB , using apt-get , or dpkg ... All the following commands failed: apt-get [install -f] [update] [remove] [purge] [autorove] [clean] [check] and options with dpkg such as: dpkg --remove --force-remove-reinstreq mysql also don't help me. Manually downloading the package and attempting to install

Ansible自动化运维(四)playbooke之roles应用(部署apache和zabbix)

别说谁变了你拦得住时间么 提交于 2020-01-26 03:01:41
一、前言 关于roles的介绍   roles能够根据层次型结构自动装在变量文件、tasks以及handlers等。要使用roles只需要在playbook中使用 include指令即可。简单来讲,roles就是通过分别将变量、文件、任务、模板及处理器放置于单独的目录中,并可以便捷地include它们的一种 机制。角色一般用于基于主机构建服务的场景中,但也可以是用于构建守护进程等场景中。   在某些复杂的场景中建议使用roles,代码复用度高:     1. 变更指定主机或主机组     2. 如 命名不规范维护和传承成本大     3. 某些功能需多个Playbook,通过includes即可实现 上一篇博客是关于playbooks的使用以及练习,相信可以体会到playbooks中,将所有的操作于模块全放到一个文件中,显得很乱,此时就有了roles。 其实roles的作用 就相当于将playbook拆分成一个个分开的文件,显示的更有结构化 roles目录结构及其作用   每个角色,以特定的层级目录结构进行组织 roles/project/ # 项目名称,有以下子目录 tasks / # 定义task,role的基本元素,至少应该包含一个名为main.yml的文件;其它的文件需要在此文件中通过include进行包含 files/ # 存放由copy或script模块等调用的文件

MySql 常用命令

▼魔方 西西 提交于 2020-01-25 16:39:11
--允许root用户远程登入 GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION --清除缓存 flush privileges; 1、启动MariaDB 安装完成MariaDB,首先启动MariaDB,两条命令都可以 systemctl start mariadb 1 或者 service mariadb start 1 设置开机启动 systemctl enable mariadb 1 或者: chkconfig mariadb on 1 2、接下来进行MariaDB的相关简单配置 mysql_secure_installation 1 首先是设置密码,会提示先输入密码 Enter current password for root (enter for none):<–初次运行直接回车 设置密码 Set root password? [Y/n] <– 是否设置root用户密码,输入y并回车或直接回车 New password: <– 设置root用户的密码 Re-enter new password: <– 再输入一次你设置的密码 1 2 3 其他配置 Remove anonymous users? [Y/n] <– 是否删除匿名用户,回车 Disallow root

MariaDB数据库升级

旧巷老猫 提交于 2020-01-25 13:50:13
如何是升级需要先对数据库进行备份: 备份数据库 mysqldump -u root -p --all-databases > alldb.sql 备份配置文件 cp /etc/my.cnf /etc/my.cnf.bak 添加 MariaDB yum库: 前往 http://yum.mariadb.org/ 查找最新版相对应系统的链接。 创建yum软件库配置文件 vi /etc/yum.repos.d/mariadb.repo 并添加下面的配置: [mariadb] name = MariaDB baseurl = http://yum.mariadb.org/10.3.4/centos7-amd64/ gpgkey= https://yum.mariadb.org/RPM-GPG-KEY-MariaDB gpgcheck=1 安装或升级最新版的 MariaDB: 升级前先停止服务:systemctl stop mariadb 安装:yum install mariadb-server 提示完成安装,安装完成后启动服务:systemctl start mariadb 来源链接: https://www.jianshu.com/p/5a20f9359164 来源: 51CTO 作者: AllenZhang2018 链接: https://blog.51cto.com/2326749

Cleaning up SQL query with nested query and inner join

落爺英雄遲暮 提交于 2020-01-25 10:15:05
问题 Been trying to reintroduce myself to SQL through some practice questions I've developed for myself, but struggling to find a better way of approaching the following problem: playlists id title 1 Title1 2 Title2 playlist_clips id playlist_id clip_id 1 Title1 3 2 Title2 1 playlist_tags playlist_id tag_id 1 1 1 2 2 2 Clips and Tags are two entirely separate tables, and I am using the playlist_tags and playlist_clips to connect them to the playlists table, to represent the two-way one-to-many

docker-compose: mariadb - Connection refused

别等时光非礼了梦想. 提交于 2020-01-25 09:21:06
问题 Step 1) mysql5 & phpmyadmin Image the following mysql-phpmyadmin configuration: version: '3.6' services: db: image: mysql:5.7.24 # image: mysql:8.0.18 # image: mariadb:10.4.8 # command: --default-authentication-plugin=mysql_native_password restart: always volumes: - ./mysql5:/var/lib/mysql # - ./mysql8:/var/lib/mysql # - ./mariadb:/var/lib/mysql environment: - MYSQL_ROOT_PASSWORD=test - MYSQL_DATABASE=test - MYSQL_USER=test - MYSQL_PASSWORD=test phpmyadmin: image: phpmyadmin/phpmyadmin:4.8.5

MariaDB Table Creation Error with Foreign Key

风流意气都作罢 提交于 2020-01-25 03:06:41
问题 There are many questions like that but I cannot find my answer among them. Can you tell me what is wrong here? The script was created by mysql Workbench but it does not except the answer -- MySQL Script generated by MySQL Workbench -- Mon Nov 26 14:14:46 2018 -- Model: New Model Version: 1.0 -- MySQL Workbench Forward Engineering SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL