赞
踩
目录
ping www.baidu.com //查看你的系统是否能ping通网络
yum -y install wget bison zlib-devel libcurl-devel boost-devel gcc gcc-c++ cmake ncurses-devel gnutls-devel libxml2-devel openssl-devel libevent-devel libaio-devel make
- cd /usr/local/src/
- wget -c https://mirrors.aliyun.com/mariadb/mariadb-10.6.7/source/mariadb-10.6.7.tar.gz
如果在本机上下载不了安装包,那就去我的网盘下载安装包,再上传到主机上
链接:https://pan.baidu.com/s/1WS3HC-Ueq-dWyWmMdQz-ww?pwd=4s8a
提取码:4s8a
tar -zxvf mariadb-10.6.7.tar.gz
- useradd -r -s /sbin/nologin -d /data/mariadb mysql
- mkdir -p /data/mariadb
- chown -R mysql /data/mariadb/
- mkdir /usr/local/mariadb
- chown -R mysql.mysql /usr/local/mariadb/
cd /usr/local/src/mariadb-10.6.7/
cmake . -DCMAKE_INSTALL_PREFIX=/usr/local/mariadb -DMYSQL_DATADIR=/data/mariadb/ -DSYSCONFDIR=/usr/local/mariadb -DMYSQL_USER=mysql -DMYSQL_TCP_PORT=3306 -DWITHOUT_TOKUDB=1 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
make
make install
- cd /usr/local/mariadb/
- cp support-files/mysql.server /etc/init.d/mysqld
- chmod +x /etc/init.d/mysqld
vim /usr/local/mariadb/my.cnf
- [mysqld]
- basedir=/usr/local/mariadb/
- datadir=/data/mariadb/
- port=3306
- pid-file=/data/mariadb/mysql.pid
- socket=/tmp/mysql.sock
-
- [mysqld_safe]
- log-error=/data/mariadb/mysql.log
-
- [client]
- port=3306
- socket=/tmp/mysql.sock
- default-character-set=utf8
- /usr/local/mariadb/scripts/mariadb-install-db --datadir=/data/mariadb
- chown -R root /usr/local/mariadb/
- chown -R mysql:mysql /data/mariadb/
- /etc/init.d/mysqld start
- ss -antl //查看是否由3306端口
- chkconfig --add mysqld
- /usr/local/mariadb/bin/mysql
/usr/local/mariadb/bin/mysql_secure_installation
- echo "export PATH=/usr/local/mariadb/bin:$PATH" > /etc/profile.d/mariadb.sh
-
- . /etc/profile.d/mariadb.sh
mysql -u root -p
本操作是在CentOS8上实现的。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。