亚洲激情专区-91九色丨porny丨老师-久久久久久久女国产乱让韩-国产精品午夜小视频观看

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

CentOS 6.6下如何編譯安裝MariaDB-10.0.24

發布時間:2021-11-11 13:53:14 來源:億速云 閱讀:156 作者:小新 欄目:MySQL數據庫

這篇文章主要為大家展示了“CentOS 6.6下如何編譯安裝MariaDB-10.0.24”,內容簡而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領大家一起研究并學習一下“CentOS 6.6下如何編譯安裝MariaDB-10.0.24”這篇文章吧。

系統環境:CentOS 6.7(Final)
MariaDB端口:3309 (因為本機原先已經裝的有MySQL了,不想刪除MySQL)

#wget http://mariadb.nethub.com.hk//mariadb-10.0.20/source/mariadb-10.0.20.tar.gz
# wget -O http://mirrors.neusoft.edu.cn/mariadb//mariadb-10.0.24/source/mariadb-10.0.24.tar.gz

建立mariadb用戶
# groupadd -r mariadb
# useradd -g mariadb -r -M -s /sbin/nologin mariadb //禁止mariadb用戶本地登錄

依賴組件
# yum -y install gcc gcc-c++ make cmake ncurses ncurses-devel libxml2 libxml2-devel openssl-devel bison bison-devel
# tar -zxvf mariadb-10.0.24.tar.gz
# cd mariadb-10.0.24
# cmake . -DMYSQL_UNIX_ADDR=/tmp/mariadb.sock -DSYSCONFDIR=/usr/local/mariadb -DMYSQL_TCP_PORT=3309 -DEXTRA_CHARSETS=all -DMYSQL_USER=mariadb -DCMAKE_INSTALL_PREFIX=/usr/local/mariadb -DMYSQL_DATADIR=/data/mariadb -DWITH_XTRADB_STORAGE_ENGINE=1 -DWITH_FEDERATEDX_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=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 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci
# make -j 4 && make install

把MariaDB服務加入系統環境變量:在最后添加下面這一行
# vim /etc/profile  
export PATH=/usr/local/mariadb/bin:$PATH
# source /etc/profile

復制配置文件
# cp /usr/local/mariadb/support-files/my-large.cnf /usr/local/mariadb/my.cnf

初始化數據庫
# /usr/local/mariadb/scripts/mysql_install_db --basedir=/usr/local/mariadb --datadir=/data/mariadb --user=mariadb --defaults-file=/usr/local/mariadb/my.cnf

復制服務啟動腳本
# cp /usr/local/mariadb/support-files/mysql.server /etc/init.d/mariadb
# vim /etc/init.d/mariadb
找到
$bindir/mysqld_safe --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
行,改為:
$bindir/mysqld_safe --defaults-file=/usr/local/mariadb/my.cnf --datadir="$datadir" --pid-file="$mysqld_pid_file_path" $other_args >/dev/null 2>&1 &
即添加了--defaults-file=/usr/local/mariadb/my.cnf
:wq
# chmod +x /etc/init.d/mariadb
# chkconfig mariadb on

配置/usr/local/mariadb/my.cnf
在[mysqld]模塊添加下面的幾行:
log-error = /usr/local/mariadb/logs/mariadb_error.log
pid-file = /usr/local/mariadb/mariadb.pid
user=mariadb
datadir = /data/mariadb
basedir = /usr/local/mariadb

新增加mysqld_safe塊
[mysqld_safe]
log-error = /usr/local/mariadb/logs/mariadb_error.log
pid-file = /usr/local/mariadb/mariadb.pid

啟動前修下目錄權限
# chown -R mariadb:mariadb /data/mariadb
# chown -R mariadb:mariadb /data/mariadb/.
# chown -R mariadb:mariadb /usr/local/mariadb
# chown -R mariadb:mariadb /usr/local/mariadb/.

啟動MariaDB:
# /etc/init.d/mariadb start
注:如果啟動失敗,查看下/usr/local/mariadb/logs/mariadb_error.log文件看報什么錯,修正即可。

設置root的密碼
# /usr/local/mariadb/bin/mysqladmin -u root password '123456'

進入MariaDB的shell下
[root@localhost mariadb]# /usr/local/mariadb/bin/mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 4
Server version: 10.0.24-MariaDB Source distribution

Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> show engines\G;

*************************** 1. row ***************************
      Engine: InnoDB
    Support: DEFAULT
    Comment: Percona-XtraDB, Supports transactions, row-level locking, and foreign keys
Transactions: YES
          XA: YES
  Savepoints: YES
*************************** 2. row ***************************
      Engine: MRG_MyISAM
    Support: YES
    Comment: Collection of identical MyISAM tables
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 3. row ***************************
      Engine: CSV
    Support: YES
    Comment: CSV storage engine
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 4. row ***************************
      Engine: BLACKHOLE
    Support: YES
    Comment: /dev/null storage engine (anything you write to it disappears)
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 5. row ***************************
      Engine: MyISAM
    Support: YES
    Comment: MyISAM storage engine
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 6. row ***************************
      Engine: MEMORY
    Support: YES
    Comment: Hash based, stored in memory, useful for temporary tables
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 7. row ***************************
      Engine: ARCHIVE
    Support: YES
    Comment: Archive storage engine
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 8. row ***************************
      Engine: PERFORMANCE_SCHEMA
    Support: YES
    Comment: Performance Schema
Transactions: NO
          XA: NO
  Savepoints: NO
*************************** 9. row ***************************
      Engine: FEDERATED
    Support: YES
    Comment: FederatedX pluggable storage engine
Transactions: YES
          XA: NO
  Savepoints: YES
*************************** 10. row ***************************
      Engine: Aria
    Support: YES
    Comment: Crash-safe tables with MyISAM heritage
Transactions: NO
          XA: NO
  Savepoints: NO
10 rows in set (0.00 sec)

ERROR: No query specified

MariaDB [mysql]> use mysql;                           //選擇系統數據庫mysql  
MariaDB [mysql]> select Host,User,Password from user; //查看所有用戶  
MariaDB [mysql]> delete from user where password="";
MariaDB [mysql]> GRANT ALL PRIVILEGES ON *.* TO root@"%" IDENTIFIED BY '123456'; //為root添加遠程連接權限
MariaDB [mysql]> flush privileges;  
MariaDB [mysql]> select Host,User,Password from user; //確認密碼為空的用戶是否已全部刪除  
MariaDB [mysql]> exit;

設置防火墻,以便局域網內的其它服務器可以訪問
# vim /etc/sysconfig/iptables
-A INPUT -m state --state NEW -m tcp -p tcp --dport 3309 -j ACCEPT
# /etc/init.d/iptables save
# /etc/init.d/iptables restart

以上是“CentOS 6.6下如何編譯安裝MariaDB-10.0.24”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

大冶市| 霸州市| 伊宁市| 龙山县| 潮州市| 梁河县| 榆中县| 江城| 仲巴县| 揭阳市| 巨野县| 曲阳县| 皋兰县| 龙游县| 密云县| 平潭县| 罗甸县| 仙居县| 那坡县| 定襄县| 永定县| 玉溪市| 榆林市| 论坛| 温州市| 含山县| 砀山县| 张家界市| 师宗县| 大荔县| 册亨县| 乡城县| 南川市| 明溪县| 寿阳县| 滨海县| 精河县| 潮安县| 溧阳市| 额敏县| 清远市|