Mysql

一、安装

MySQL :: Other MySQL Documentation
在Linux环境下mysql的root密码忘记解决方法(三种)_Mysql_脚本之家

# https://downloads.mariadb.org/mariadb/repositories/#mirror=tuna
# MariaDB 10.6 CentOS repository list - created 2021-09-26 08:49 UTC
# http://downloads.mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.6/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

sudo yum install MariaDB-server MariaDB-client

systemctl start mariadb
systemctl enable mariadb
mysql_secure_installation

# https://dev.mysql.com/downloads/mysql/5.7.html#downloadsupdate user set host='%' where user ='root';
# http://www.weiwei.wang/2020/11/13/cdhcloud-distribution-hadoop%E5%AE%89%E8%A3%85%E9%83%A8%E7%BD%B2/
rpm -ev --nodeps 文件名      # 离线安装需要先自带的 mariadb
yum install mysql-server
mysqld --initialize --user=mysql  # 初始化
alter user 'root'@'localhost' identified by 'xxxxxxx';
update user set host='%' where user ='root';
flush privileges;

二、基础命令

基础命令

三、存储过程

Procedure

四、MySQL的高可用方式

  1. 原理:从主服务器复制一个或多个从服务器的异步过程。在主和从之间实现整个复制过程主要由三个线程来完成:I/O线程在主服务器,另外两个线程(SQL线程和I/O线程)在从服务器端;
  2. 具体实现过程从服务器I/O线程请求连接上主服务器,主服务器收到通过自身I/O线程返回指定的日志信息,从服务器I/O收到将获取的数据记录到master-info中,同时SQL线程解析数据内容并执行;
  3. MySQL主从同步详解与配置

image

posted on 2023-04-13 00:19  anyu967  阅读(6)  评论(0)    收藏  举报