新网创想网站建设,新征程启航

为企业提供网站建设、域名注册、服务器等服务

Mariadb10.2.30安装(二进制、源码编译)-创新互联

----------Mariadb 10.2.30 安装-----------

创新互联公司专注为客户提供全方位的互联网综合服务,包含不限于网站建设、成都网站建设、沛县网络推广、小程序开发、沛县网络营销、沛县企业策划、沛县品牌公关、搜索引擎seo、人物专访、企业宣传片、企业代运营等,从售前售中售后,我们都将竭诚为您服务,您的肯定,是我们大的嘉奖;创新互联公司为所有大学生创业者提供沛县建站搭建服务,24小时服务热线:18980820575,官方网址:www.cdcxhl.com

一、源码编译安装

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                    = 3306 socket                    = /tmp/mysql.sock [mysqld] port                    = 3306 socket                    = /tmp/mysql.sock skip-external-locking key_buffer_size                = 256M max_allowed_packet             = 1M 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 datadir                        = /data_linux/mysql/3306/data innodb_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 = 2 innodb_lock_wait_timeout       = 50 innodb_file_per_table          = ON  skip_name_resolve              = ON  [mysqldump] quick max_allowed_packet             = 16M [mysql] no-auto-rehash [myisamchk] key_buffer_size                = 128M sort_buffer_size               = 128M read_buffer                    = 2M write_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/data mkdir -p /home/logs/mysql useradd mysql chown -R mysql:mysql /data/mysql chown -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                  = mysql datadir                 = /data/mysql/data port                   = 3306 pid-file                = /tmp/mysql.pid socket                 = /tmp/mysql.sock server-id                = 2 default-storage-engine         = InnoDB character-set-client-handshake         = FALSE character-set-server           = utf8mb4 collation-server            = utf8mb4_unicode_ci init_connect              = 'SET NAMES utf8mb4' performance-schema-instrument          = 'memory/%=COUNTED' interactive_timeout           = 172800 wait_timeout              = 172800 tmp-table-size             = 8M max-heap-table-size           = 4M query-cache-type            = 0 query-cache-size            = 64M max-connections             = 80 thread-cache-size            = 50 open-files-limit            = 65535 table-definition-cache         = 4096 table-open-cache            = 10 innodb-flush-method           = O_DIRECT innodb-log-files-in-group         = 2 innodb-log-file-size          = 256M innodb-flush-log-at-trx-commit         = 1 innodb-file-per-table          = 1 innodb-buffer-pool-size         = 3G log-error                = /home/logs/mysql/mysql_error.log slow-query-log             = 1 slow-query-log-file           = /home/logs/mysql/mysql_slow.log long_query_time             = 0.2 min_examined_row_limit         = 100 max-allowed-packet            = 16M max-connect-errors           = 1000000 #skip-name-resolve sql-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_SUBSTITUTION sysdate-is-now             = 1 innodb-strict-mode           = 1 sort_buffer_size            = 2M join_buffer_size            = 2M key_buffer_size             = 64M read_buffer_size            = 512K read_rnd_buffer_size          = 256K binlog_cache_size            = 2M thread_stack              = 256K bulk_insert_buffer_size          = 64M lower_case_table_names          = 1 relay-log                = /home/logs/mysql/mysql_relay.log relay_log_recovery           = 1 slave-net-timeout            = 60 relay_log_purge             = 0 sync_binlog               = 1 log-bin                 = /data/mysql/mysql_bin.log binlog_format              = ROW expire-logs-days            = 2 relay_log_recovery           = 1 slave_skip_errors            = ddl_exist_errors explicit_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]# mysql Welcome to the MariaDB monitor.  Commands end with ; or \g. Your MariaDB connection id is 12 Server version: 10.2.30-MariaDB-log Source distribution Copyright (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)]>

另外有需要云服务器可以了解下创新互联cdcxhl.cn,海内外云服务器15元起步,三天无理由+7*72小时售后在线,公司持有idc许可证,提供“云服务器、裸金属服务器、高防服务器、香港服务器、美国服务器、虚拟主机、免备案服务器”等云主机租用服务以及企业上云的综合解决方案,具有“安全稳定、简单易用、服务可用性高、性价比高”等特点与优势,专为企业上云打造定制,能够满足用户丰富、多元化的应用场景需求。


文章标题:Mariadb10.2.30安装(二进制、源码编译)-创新互联
链接分享:http://wjwzjz.com/article/degpds.html
在线咨询
服务热线
服务热线:028-86922220
TOP