二進制安裝mariadb數據庫10.5.3版本mysql
因爲mariadb10.5.3版本是2020年5月12日發佈因此爲了嚐鮮,今天特意二進制編譯了一下 #進入到/usr/local/src目錄下,而後經過在清華源上下載10.5.3版本的mariadb數據庫linux
[22:29:34 root@a7 ~]#wget https://mirrors.tuna.tsinghua.edu.cn/mariadb/mariadb-10.5.3/bintar-linux-systemd-x86_64/mariadb-10.5.3-linux-systemd-x86_64.tar.gz
#建立mysql用戶面試
[22:32:59 root@a7 ~]#useradd mysql -s /sbin/nologin -M
#建立自定義數據庫目錄sql
[22:33:15 root@a7 ~]#mkdir /data/mysql/mysql3306/{data,binlog,logs,tmp} -p
#對mysql3306這個目錄進行受權,受權給mysql用戶數據庫
[22:49:32 root@a7 ~]#cd /data/mysql/;chown -R mysql.mysql mysql3306
#安裝相關依賴包vim
22:49:33 root@a7 mysql]#yum install libaio.x86_64 libaio-devel.x86_64 novacom-server.x86_64 libedit -y
#回到root目錄,解壓安裝包、指定解壓到/usr/local網絡
[22:50:11 root@a7 mysql]#cd [18:04:45 root@a7 ~]#tar xf mariadb-10.5.3-linux-systemd-x86_64.tar.gz -C /usr/local/
#進入到/usr/local/src目錄下添加一個mysql的軟鏈接架構
[17:13:49 root@a7 ~]#cd /usr/local/ [17:21:14 root@a7 local]#ln -s mariadb-10.5.3-linux-systemd-x86_64 mysql
#提示:初始化時要在/usr/local/mysql/ 目錄下建立一個空的影藏文件.my.cnf文件,不然會提示文件不存在,致使初始化失敗。運維
[17:21:14 root@a7 local]#cd /usr/local/mysql/;touch .my.cnf
#初始化命令socket
[17:25:50 root@a7 mysql]#./scripts/mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/data/mysql/mysql3306/data --defaults-file=./.my.cnf
#修改/etc/my.cnf配置文件、指定數據庫存放目錄。
[22:36:11 root@a7 mysql]#vim /etc/my.cnf [mysqld]
datadir=/data/mysql/mysql3306/data
#指定數據庫存放目錄 socket=/tmp/mysql.sock
#指定啓動的sock文件
# Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # Settings user and group are ignored when systemd is used. # If you need to run mysqld under a different user or group, # customize your systemd unit file for mariadb according to the # instructions in http://fedoraproject.org/wiki/Systemd [mysqld_safe] log-error=/var/log/mariadb/mariadb.log pid-file=/var/run/mariadb/mariadb.pid # # include all files from the config directory # !includedir /etc/my.cnf.d
#初始化好了就配置mariadb啓動方式
[22:23:08 root@a7 mysql]#cp support-files/systemd/mariadb.service /usr/lib/systemd/system/mariadb.service
#啓動mariadb服務
[22:59:25 root@a7 mysql]#systemctl start mariadb
#而後在查看端口、3306已經起來
[22:59:28 root@a7 mysql]#ss -ntl State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:111 *:* LISTEN 0 5 192.168.122.1:53 *:* LISTEN 0 128 *:22 *:* LISTEN 0 128 127.0.0.1:631 *:* LISTEN 0 100 127.0.0.1:25 *:* LISTEN 0 128 127.0.0.1:6010 *:* LISTEN 0 128 127.0.0.1:6011 *:* LISTEN 0 80 :::3306 :::*
#作軟鏈接,經過mysql命令來進入交互模式
[23:15:57 root@a7 mysql]#ln -s /usr/local/mysql/bin/mysql /usr/bin/ [23:16:07 root@a7 mysql]#mysql Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 5 Server version: 10.5.3-MariaDB MariaDB Server 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)]>
#以上maridb10.5.3數據庫的二進制編譯安裝
※部分文章來源於網絡,若有侵權請聯繫刪除;更多文章和資料|點擊後方文字直達 ↓↓↓ 100GPython自學資料包 阿里雲K8s實戰手冊 [阿里雲CDN排坑指南]CDN ECS運維指南 DevOps實踐手冊 Hadoop大數據實戰手冊 Knative雲原生應用開發指南 OSS 運維實戰手冊 雲原生架構白皮書 Zabbix企業級分佈式監控系統源碼文檔 10G大廠面試題戳領