Mariadb 10.2.30 安装(二进制、源码编译)
发表于:2025-01-22 作者:千家信息网编辑
千家信息网最后更新 2025年01月22日,----------Mariadb 10.2.30 安装-----------一、源码编译安装1、安装依赖#mkdir -pv /data_linux/mysql/3306/{data,logs/{b
千家信息网最后更新 2025年01月22日Mariadb 10.2.30 安装(二进制、源码编译)
----------Mariadb 10.2.30 安装-----------
一、源码编译安装
1、安装依赖
#mkdir -pv /data_linux/mysql/3306/{data,logs/{binlog,relaylog}}#yum -y install libaio libaio-devel \bison bison-devel zlib-devel openssl \openssl-devel ncurses ncurses-devel \libcurl-devel libarchive-devel boost \boost-devel lsof wget gcc gcc-c++ make \cmake perl kernel-headers kernel-devel pcre-devel
2、下载源码包
#wget http://mirror.rackspace.com/mariadb//mariadb-10.2.30/source/mariadb-10.2.30.tar.gz
3、编译安装
#cmake \-DCMAKE_INSTALL_PREFIX=/usr/local/mysql \-DMYSQL_DATADIR=/data_linux/mysql/3306/data \-DSYSCONFDIR=/etc \-DWITH_INNOBASE_STORAGE_ENGINE=1 \-DWITH_ARCHIVE_STORAGE_ENGINE=1 \-DWITH_BLACKHOLE_STORAGE_ENGINE=1 \-DWITH_READLINE=1 \-DWITH_SSL=system \-DWITH_ZLIB=system \-DWITH_LIBWRAP=0 \-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \-DDEFAULT_CHARSET=utf8 \-DDEFAULT_COLLATION=utf8_general_ci \-DMYSQL_UNIX_ADDR=/tmp/mysql.sock \-DENABLED_LOCAL_INFILE=1 \-DWITH_PARTITION_STORAGE_ENGINE=1 \-DWITH_DEBUG=0 \-DWITHOUT_MROONGA_STORAGE_ENGINE=1如果报错,按照报错提示安装相应的依赖,然后删除当前目录下的CMakeCache.txt文件后,重新编译,直到无error报错。#make#make install
4、安装完环境准备
#chown -R mysql:mysql /usr/local/mysql/#cp support-files/my-large.cnf /etc/my.cnf#[root@deploy mariadb-10.2.30]# cat /etc/my.cnf[client]port = 3306socket = /tmp/mysql.sock[mysqld]port = 3306socket = /tmp/mysql.sockskip-external-lockingkey_buffer_size = 256Mmax_allowed_packet = 1Mtable_open_cache = 256sort_buffer_size = 1Mread_buffer_size = 1Mread_rnd_buffer_size = 4Mmyisam_sort_buffer_size = 64Mthread_cache_size = 8query_cache_size = 16Mthread_concurrency = 8log-bin=mysql-binbinlog_format = mixedserver-id = 1datadir = /data_linux/mysql/3306/datainnodb_data_home_dir = /data_linux/mysql/3306/data innodb_data_file_path = ibdata1:10M:autoextend innodb_log_group_home_dir = /data_linux/mysql/3306/data innodb_buffer_pool_size = 256M innodb_log_file_size = 64M innodb_log_buffer_size = 8M innodb_flush_log_at_trx_commit = 2innodb_lock_wait_timeout = 50innodb_file_per_table = ON skip_name_resolve = ON [mysqldump]quickmax_allowed_packet = 16M[mysql]no-auto-rehash[myisamchk]key_buffer_size = 128Msort_buffer_size = 128Mread_buffer = 2Mwrite_buffer = 2M[mysqlhotcopy]interactive-timeout
5、初始化服务
#cp support-files/mysql.server /etc/rc.d/init.d/mysqld#chmod +x /etc/rc.d/init.d/mysqld#/etc/init.d/mysqld start
二、二进制安装
二进制包下载地址:
wget https://downloads.mariadb.org/interstitial/mariadb-10.2.30/bintar-linux-systemd-x86_64/mariadb-10.2.30-linux-systemd-x86_64.tar.gz/from/http%3A//mirror.rackspace.com/mariadb/
1.规划:
数据文件存储位置 /data/mysql/data
日志文件存储位置 /home/logs/mysql
binlog文件存储位置 /data/mysql
2.创建目录和授权:
mkdir -p /data/mysql/datamkdir -p /home/logs/mysqluseradd mysqlchown -R mysql:mysql /data/mysqlchown -R mysql:mysql /home/logs
3、解压文件
#tar -xzvf mariadb-10.2.30-linux-systemd-x86_64.tar.gz -C /usr/local#mv /usr/local/mariadb-10.2.30-linux-systemd-x86_64 /usr/local/mysql
4、配置文件
#cat /etc/my.cnf[client]socket = /tmp/mysql.sock[mysqld]user = mysqldatadir = /data/mysql/dataport = 3306pid-file = /tmp/mysql.pidsocket = /tmp/mysql.sockserver-id = 2default-storage-engine = InnoDBcharacter-set-client-handshake = FALSEcharacter-set-server = utf8mb4collation-server = utf8mb4_unicode_ciinit_connect = 'SET NAMES utf8mb4'performance-schema-instrument = 'memory/%=COUNTED'interactive_timeout = 172800wait_timeout = 172800tmp-table-size = 8Mmax-heap-table-size = 4Mquery-cache-type = 0query-cache-size = 64Mmax-connections = 80thread-cache-size = 50open-files-limit = 65535table-definition-cache = 4096table-open-cache = 10innodb-flush-method = O_DIRECTinnodb-log-files-in-group = 2innodb-log-file-size = 256Minnodb-flush-log-at-trx-commit = 1innodb-file-per-table = 1innodb-buffer-pool-size = 3Glog-error = /home/logs/mysql/mysql_error.logslow-query-log = 1slow-query-log-file = /home/logs/mysql/mysql_slow.loglong_query_time = 0.2min_examined_row_limit = 100max-allowed-packet = 16Mmax-connect-errors = 1000000#skip-name-resolvesql-mode = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTIONsysdate-is-now = 1innodb-strict-mode = 1sort_buffer_size = 2Mjoin_buffer_size = 2Mkey_buffer_size = 64Mread_buffer_size = 512Kread_rnd_buffer_size = 256Kbinlog_cache_size = 2Mthread_stack = 256Kbulk_insert_buffer_size = 64Mlower_case_table_names = 1relay-log = /home/logs/mysql/mysql_relay.logrelay_log_recovery = 1slave-net-timeout = 60relay_log_purge = 0sync_binlog = 1log-bin = /data/mysql/mysql_bin.logbinlog_format = ROWexpire-logs-days = 2relay_log_recovery = 1slave_skip_errors = ddl_exist_errorsexplicit_defaults_for_timestamp = true
5、数据初始化
#/usr/local/mysql/scripts/mysql_install_db --basedir=/usr/local/mysql --datadir=/data/mysql/data --user=mysql
6、设置启动文件
# cp /usr/local/mysql/support-files/mysql.server /etc/init.d/mysql
7、启动
#/etc/init.d/mysql start
8、连接
explicit_defaults_for_timestamp = true[root@deploy local]# mysqlWelcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 12Server version: 10.2.30-MariaDB-log Source distributionCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]>
文件
编译
位置
存储
二进制
源码
数据
目录
地址
日志
果报
环境
准备
提示
服务
规划
配置
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
网络安全属于国家工程项目吗
物联网中的社交网络技术
医保系统网络安全检查表
联通信息安全部软件开发
国家网络安全宣传国旗讲话
河南crm软件开发价格
三丰服务器自动安装
幻塔为什么有时候连接不上服务器
wcl怎么看服务器最新击杀进度
江苏通信网络安全防护
服务器放在配电间
车载网络技术can
网络安全法漏洞管理
广东精益管理软件开发
云南正规软件开发报价
三年级网络安全知识小报内容
sql数据库外键操作
银行部门软件开发岗位
溆浦软件开发有限公司
广东省双进网络安全专题活动
图们市天气预报软件开发
村委会网络安全宣传语
软件开发的起什么名字好
数据库5NF解释
软件开发公司要什么岗位
网络安全战士绘画
有关网络安全英语作文约100字
广东省学网络安全的大专
软件开发比赛作品
软件开发团队 领导讲话