源码包安装mysql

源码包安装mysql5.7过程
graph LR
wget下载或者官网下载mysql-->新建/etc/my.cnf配置文件

新建/etc/my.cnf配置文件-->安装配置文件新建/mysql/data文件夹

安装配置文件新建/mysql/data文件夹-->初始化数据库

初始化数据库-->启动数据库

启动数据库-->指定本地socket连接



步骤说明
初始化数据库说明:
root@vm0a:/usr/local/mysql-5.7/bin# ./mysqld --initialize-insecure --user=root --basedir=/usr/local/mysql-5.7 --datadir=/usr/local/mysql-5.7/data
my.cnf配置文件说明:
[client]
user=root
password=1
socket=/tmp/mysql.sock
[mysql]
#mysql客户端默认字符集
default-character-set=utf8
socket=/tmp/mysql.sock
[mysqld]
socket=/tmp/mysql.sock
#跳过权限表校验
skip-grant-tables
skip-name-resolve
#设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=/usr/local/mysql-5.7
# 设置mysql数据库的数据的存放目录
datadir=/usr/local/mysql-5.7/data
# 允许最大连接数
max_connections=200
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB
lower_case_table_names=1
max_allowed_packet=16M

server_id=19
gtid_mode=on
enforce_gtid_consistency=on
master_info_repository=table
relay_log_info_repository=table
binlog_checksum=none
log_slave_updates=on
log_bin=mysql-bin
binlog_format=row

transaction_write_set_extraction=XXHASH64
loose-group_replication_group_name="aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
loose-group_replication_start_on_boot=off
loose-group_replication_local_address= "192.168.59.132:33060"
loose-group_replication_group_seeds= "192.168.59.134:33060,192.168.59.133:33060,192.168.59.132:33060"
loose-group_replication_bootstrap_group= off

启动数据库
root@vm0a:/usr/local/mysql-5.7/bin# ./mysqld --user=root
指定socket连接
mysql -uroot -p -S /tmp/mysql.sock

你可能感兴趣的:(源码包安装mysql)