Mariadb 安装及配置
https://iluoy.com/articles/97 安装
https://my.oschina.net/iluckyboy/blog/215949 安装
https://blog.51cto.com/xianglinhu/1702472 参数
https://juejin.im/post/5c47e65251882523ea6e0924 内存优化
https://www.jianshu.com/p/e67f1dbaa107 安装配置用户
https://blog.51cto.com/gaowenlong/1888036 keeplived mariadb 主从vip
https://blog.51cto.com/kerry/2286086
# MariaDB 10.2 CentOS repository list - created 2017-07-03 06:59 UTC # http://downloads.mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = https://mirrors.ustc.edu.cn/mariadb/yum/10.2/centos7-amd64 gpgkey=https://example.com/mariadb/yum/RPM-GPG-KEY-MariaDB gpgcheck=1 yum install MariaDB-server MariaDB-client rm -rf /var/lib/mysql mkdir /data/mysql vim /etc/my.cnf.d/mysql-clients.cnf [client] port = 3306 socket = /data/mysql/mysql.sock [mysql] no-auto-rehash [mysqldump] quick max_allowed_packet = 64M [myisamchk] key_buffer_size = 128M sort_buffer_size = 128M read_buffer = 2M write_buffer = 2M [mysqlhotcopy] interactive-timeout vim /etc/my.cnf.d/server.cnf #性能参数来自my-large.ini [mysqld] port = 3306 datadir = /data/mysql socket = /data/mysql/mysql.sock skip-external-locking key_buffer_size = 256M max_allowed_packet = 64M table_open_cache = 256 sort_buffer_size = 1M read_buffer_size = 1M read_rnd_buffer_size = 4M myisam_sort_buffer_size = 64M thread_cache_size = 8 query_cache_size= 16M thread_concurrency = 8 log-bin=mysql-bin binlog_format=mixed server-id = 1 mysql_install_db --defaults-file=/etc/my.cnf --datadir=/data/mysql/ --user=mysql systemctl enable mariadb.service systemctl start mariadb.service mysqladmin -u root password "Szyrw@2012" # root可从任何IP登陆,注意修改密码:YOUR_PASSWORD mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '888888' WITH GRANT OPTION; # root可从指定IP登陆,注意修改密码:YOUR_PASSWORD mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.1.188' IDENTIFIED BY '888888' WITH GRANT OPTION; mysql>FLUSH RIVILEGES 本文由作者按照 CC BY 4.0 进行授权