Centos7下编译安装mariadb 博客分类: Linux Centos7MariaDB
程序员文章站
2024-03-17 00:02:34
...
https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.3.10/source/mariadb-10.3.10.tar.gz
https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.2.18/source/mariadb-10.2.18.tar.gz
https://mariadb.com/kb/en/library/installing-mariadb-binary-tarballs/ 二进制Tarballs包安装说明(官网)
实操:
# yum -y install ncurses-devel openssl-devel libevent-devel jemallloc-devel cmake
# yum -y install gcc gcc++ gcc-c++
# yum -y install bison
# groupadd -r mysql == -r 创建一个系统组。
# useradd -g mysql -s /sbin/nologin mysql
# mkdir /usr/local/mysql
# mkdir -pv /data/mysql == -v print a message for each created directory
# chown -R mysql:mysql /data/mysql/
# cd /usr/local/src
# wget https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.2.18/source/mariadb-10.2.18.tar.gz
# tar -zxvf mariadb-10.2.18.tar.gz
# cd mariadb-10.2.18
# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc -DWITHOUT_TOKUDB=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STPRAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWIYH_READLINE=1 -DWIYH_SSL=system -DVITH_ZLIB=system -DWITH_LOBWRAP=0 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
【
# make clean 清理此前的编译所生成的文件
# rm -rf CMakeCache.txt
】
# make && make install
后续设置
# cd /usr/local/mysql/
# chown –R mysql:mysql .
# scripts/mysql_install_db –datadir=/data/mysql –user=mysql ==安装系统数据库
# chown –R root .
# cp support-files/my-huge.cnf /etc/my.cnf
# vim /etc/my.cnf
在[mysqld]部分增加 datadir=/data/mysql/
# vim /etc/profile ==把mariadb库文件链接到默认位置
export PATH=$PATH:/usr/local/mysql/bin
# ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
# ln -s /usr/local/mysql/include/mysql /usr/include/mysql
# vim /etc/systemd/system/mariadb.service
[Unit]
Description=MariaDB server and services
After=syslog.target
After=network.target
[Service]
Type=simple
User=mysql
Group=mysql
ExecStart=/usr/local/mysql/bin/mysqld_safe --basedir=/usr/local/mysql
TimeoutSec=300
PrivateTmp=false
[Install]
WantedBy=multi-user.target
# systemctl daemon-reload
# systemctl start mariadb
# systemctl enable mariadb
# export PATH=$PATH:/usr/local/mysql/bin ==不重启系统直接使用新PATH
# mysql_secure_installation ==初始化数据库运行环境
https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.2.18/source/mariadb-10.2.18.tar.gz
https://mariadb.com/kb/en/library/installing-mariadb-binary-tarballs/ 二进制Tarballs包安装说明(官网)
实操:
# yum -y install ncurses-devel openssl-devel libevent-devel jemallloc-devel cmake
# yum -y install gcc gcc++ gcc-c++
# yum -y install bison
# groupadd -r mysql == -r 创建一个系统组。
# useradd -g mysql -s /sbin/nologin mysql
# mkdir /usr/local/mysql
# mkdir -pv /data/mysql == -v print a message for each created directory
# chown -R mysql:mysql /data/mysql/
# cd /usr/local/src
# wget https://mirrors.tuna.tsinghua.edu.cn/mariadb//mariadb-10.2.18/source/mariadb-10.2.18.tar.gz
# tar -zxvf mariadb-10.2.18.tar.gz
# cd mariadb-10.2.18
# cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mysql -DMYSQL_DATADIR=/data/mysql -DSYSCONFDIR=/etc -DWITHOUT_TOKUDB=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STPRAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DWIYH_READLINE=1 -DWIYH_SSL=system -DVITH_ZLIB=system -DWITH_LOBWRAP=0 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
【
# make clean 清理此前的编译所生成的文件
# rm -rf CMakeCache.txt
】
# make && make install
后续设置
# cd /usr/local/mysql/
# chown –R mysql:mysql .
# scripts/mysql_install_db –datadir=/data/mysql –user=mysql ==安装系统数据库
# chown –R root .
# cp support-files/my-huge.cnf /etc/my.cnf
# vim /etc/my.cnf
在[mysqld]部分增加 datadir=/data/mysql/
# vim /etc/profile ==把mariadb库文件链接到默认位置
export PATH=$PATH:/usr/local/mysql/bin
# ln -s /usr/local/mysql/lib/mysql /usr/lib/mysql
# ln -s /usr/local/mysql/include/mysql /usr/include/mysql
# vim /etc/systemd/system/mariadb.service
[Unit]
Description=MariaDB server and services
After=syslog.target
After=network.target
[Service]
Type=simple
User=mysql
Group=mysql
ExecStart=/usr/local/mysql/bin/mysqld_safe --basedir=/usr/local/mysql
TimeoutSec=300
PrivateTmp=false
[Install]
WantedBy=multi-user.target
# systemctl daemon-reload
# systemctl start mariadb
# systemctl enable mariadb
# export PATH=$PATH:/usr/local/mysql/bin ==不重启系统直接使用新PATH
# mysql_secure_installation ==初始化数据库运行环境
上一篇: Go语言中method方法的继承与重写
下一篇: linux常用命令 linux
推荐阅读
-
centos7 快速安装 mariadb(mysql) 博客分类: 【25】、linux【5】、数据库 centos7mysqlmariadb
-
Centos7下编译安装mariadb 博客分类: Linux Centos7MariaDB
-
用U盘安装CentOS7 博客分类: linux CentOS
-
用U盘安装CentOS7 博客分类: linux CentOS
-
Mongodb在Linux下的安装和启动和配置(转载) 博客分类: MongDB MongDB
-
linux下安装redis 启动,停止,连接 博客分类: redis linuxredis安装目录
-
ubuntu 下安装 jdk+eclipse 博客分类: linux linuxeclipseubuntu 12.04jdkprofile
-
ubuntu 下安装 jdk+eclipse 博客分类: linux linuxeclipseubuntu 12.04jdkprofile
-
Centos7.0下编译安装FFmpeg4.0.2 博客分类: 音视频 centosFFmpegyasmsdl2libx264
-
[转] Linux下RPM软件包的安装及卸载 博客分类: linux linuxrpm