午夜精品人妻久久久-成年美女很黄的网站-在线看片免费人成视久网app-国产精品美女无遮挡一区二区-91精品国产综合久久久久-国产的免费视频又猛又爽又刺激-在线看片免费人成视久网app-久久香蕉国产精品视频-av一区二区三区高清

在 CentOS 7 CPanel 服務(wù)器上安裝 MariaDB 10

是一個(gè)增強(qiáng)版的、開源的 MySQL 替代品 。它主要由社區(qū)在維護(hù),采用 GPL v2 授權(quán)許可 。軟件的安全性是開發(fā)者的主要焦點(diǎn) 。他們保持為的每個(gè)版本發(fā)布安全補(bǔ)丁 。當(dāng)有任何安全問題被發(fā)現(xiàn)時(shí),開發(fā)者會(huì)盡快修復(fù)并推出的新版本 。
的優(yōu)勢
在這篇文章中,我將談?wù)撽P(guān)于如何在服務(wù)器上升級 .5 到最新的。在安裝前先完成以下步驟 。
先決條件:
1. 停止當(dāng)前 MySQL 服務(wù)

  1. root@server1 [/var/]# mysql
  2. Welcome to the MySQL monitor. Commands end with ; or g.
  3. Your MySQL connection id is 5859
  4. Server version: 5.5.47-cll MySQL Community Server (GPL)
  5. Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
  6. Oracle is a registered trademark of Oracle Corporation and/or its
  7. affiliates. Other names may be trademarks of their respective
  8. owners.
  9. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
  10. root@server1 [~]# systemctl stop mysql
  11. root@server1 [~]# systemctl status mysql
  12. ● mysql.service - LSB: start and stop MySQL
  13. Loaded: loaded (/etc/rc.d/init.d/mysql)
  14. Active: failed (Result: exit-code) since Sun 2016-01-31 10:00:02 UTC; 1min 31s ago
  15. Docs: man:systemd-sysv-generator(8)
  16. Main PID: 23430 (code=exited, status=203/EXEC)
  17. Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Started MySQL Server.
  18. Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Starting MySQL Server...
  19. Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service: main process exited, code=exited, status=203/EXEC
  20. Jan 31 10:00:02 server1.centos7-test.com systemd[1]: Unit mysql.service entered failed state.
  21. Jan 31 10:00:02 server1.centos7-test.com systemd[1]: mysql.service failed.

2. 在升級之前將所有配置文件和數(shù)據(jù)庫轉(zhuǎn)移
轉(zhuǎn)移數(shù)據(jù)庫的存儲路徑和 MySQL 的配置文件
  1. root@server1 [~]# cp -Rf /var/lib/mysql /var/lib/mysql-old
  2. root@server1 [/var/lib/mysql]# cat /etc/my.cnf
  3. [mysqld]
  4. default-storage-engine=MyISAM
  5. innodb_file_per_table=1
  6. max_allowed_packet=268435456
  7. open_files_limit=10000
  8. root@server1 [~]#mv /etc/my.cnf /etc/my.cnf-old

3. 從服務(wù)器上刪除和卸載 MySQL 所有的 RPM 包
運(yùn)行以下命令來禁用 MySQL RPM 的目標(biāo) 。通過運(yùn)行此命令, 將不再處理 MySQL 的更新,并在系統(tǒng)上將這些 RPM 版本標(biāo)記為已卸載 。
  1. /scripts/update_local_rpm_versions --edit target_settings.MySQL50 uninstalled
  2. /scripts/update_local_rpm_versions --edit target_settings.MySQL51 uninstalled
  3. /scripts/update_local_rpm_versions --edit target_settings.MySQL55 uninstalled
  4. /scripts/update_local_rpm_versions --edit target_settings.MySQL56 uninstalled

現(xiàn)在運(yùn)行以下命令:
  1. /scripts/checkcpanelrpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56

移除服務(wù)器上所有已有的 MySQL RPM 來為的安裝清理環(huán)境 。請看下面的輸出:
  1. root@server1 [/var/lib/mysql]# /scripts/check_cpanel_rpms --fix --targets=MySQL50,MySQL51,MySQL55,MySQL56
  2. [2016-01-31 09:53:59 +0000]
  3. [2016-01-31 09:53:59 +0000] Problems were detected with cPanel-provided files which are RPM controlled.
  4. [2016-01-31 09:53:59 +0000] If you did not make these changes intentionally, you can correct them by running:
  5. [2016-01-31 09:53:59 +0000]
  6. [2016-01-31 09:53:59 +0000] > /usr/local/cpanel/scripts/check_cpanel_rpms --fix
  7. [2016-01-31 09:53:59 +0000]
  8. [2016-01-31 09:53:59 +0000] The following RPMs are unneeded on your system and should be uninstalled:
  9. [2016-01-31 09:53:59 +0000] MySQL55-client-5.5.47-1.cp1148
  10. [2016-01-31 09:53:59 +0000] MySQL55-devel-5.5.47-1.cp1148
  11. [2016-01-31 09:53:59 +0000] MySQL55-server-5.5.47-1.cp1148
  12. [2016-01-31 09:53:59 +0000] MySQL55-shared-5.5.47-1.cp1148
  13. [2016-01-31 09:53:59 +0000] MySQL55-test-5.5.47-1.cp1148
  14. [2016-01-31 09:53:59 +0000] compat-MySQL50-shared-5.0.96-4.cp1136
  15. [2016-01-31 09:53:59 +0000] compat-MySQL51-shared-5.1.73-1.cp1150
  16. [2016-01-31 09:53:59 +0000] Removing 0 broken rpms:
  17. [2016-01-31 09:53:59 +0000] rpm: no packages given for erase
  18. [2016-01-31 09:53:59 +0000] No new RPMS needed for install
  19. [2016-01-31 09:53:59 +0000] Disabling service monitoring.
  20. [2016-01-31 09:54:01 +0000] Uninstalling unneeded rpms: MySQL55-test MySQL55-server MySQL55-client compat-MySQL51-shared compat-MySQL50-shared MySQL55-shared MySQL55-devel
  21. [2016-01-31 09:54:04 +0000] Removed symlink /etc/systemd/system/multi-user.target.wants/mysql.service.
  22. [2016-01-31 09:54:04 +0000] Restoring service monitoring.

通過這些步驟,我們已經(jīng)卸載了現(xiàn)有的 MySQL RPM,并做了標(biāo)記來防止 MySQL的更新,服務(wù)器的環(huán)境已經(jīng)清理查看mysql服務(wù)安裝路徑,然后準(zhǔn)備安裝。
開始安裝吧,我們需要根據(jù)和的版本為創(chuàng)建一個(gè) yum 軟件庫 。下面是我的做法!
安裝步驟:
第1步:創(chuàng)建 YUM 軟件庫 。
  1. root@server1 [~]# vim /etc/yum.repos.d/MariaDB.repo
  2. [mariadb]
  3. name = MariaDB
  4. baseurl = http://yum.mariadb.org/10.0/centos7-amd64/
  5. gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  6. gpgcheck=1
  7. root@server1 [/etc/yum.repos.d]# cat /etc/yum.repos.d/MariaDB.repo
  8. [mariadb]
  9. name = MariaDB
  10. baseurl = http://yum.mariadb.org/10.0/centos7-amd64/
  11. gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
  12. gpgcheck=1

第2步:打開 /etc/yum.conf 并修改如下行:
刪除這一行:
  1. exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* mysql* nsd* php* proftpd* pure-ftpd* spamassassin* squirrelmail*

替換為:
  1. exclude=courier* dovecot* exim* filesystem httpd* mod_ssl* mydns* nsd* proftpd* pure-ftpd* spamassassin* squirrelmail*

重要
需要確保我們已經(jīng)從列表中移除了 MySQL 和 PHP 。
第3步:運(yùn)行以下命令來安裝和相關(guān)的包 。
  1. root@server1 [~]#yum install MariaDB-server MariaDB-client MariaDB-devel php-mysql
  2. Dependencies Resolved
  3. ===============================================================================================================================================
  4. Package Arch Version Repository Size
  5. ===============================================================================================================================================
  6. Installing:
  7. MariaDB-client x86_64 10.0.23-1.el7.centos mariadb 10 M
  8. MariaDB-devel x86_64 10.0.23-1.el7.centos mariadb 6.3 M
  9. MariaDB-server x86_64 10.0.23-1.el7.centos mariadb 55 M
  10. php-mysql x86_64 5.4.16-36.el7_1 base 99 k
  11. Installing for dependencies:
  12. MariaDB-common x86_64 10.0.23-1.el7.centos mariadb 43 k
  13. MariaDB-shared x86_64 10.0.23-1.el7.centos mariadb 1.2 M
  14. libzip x86_64 0.10.1-8.el7 base 48 k
  15. php-common x86_64 5.4.16-36.el7_1 base 563 k
  16. php-pdo x86_64 5.4.16-36.el7_1 base 97 k
  17. Transaction Summary
  18. ===============================================================================================================================================
  19. Install 4 Packages (+5 Dependent package)

第4步:重新啟動(dòng),并確保 MySQL 服務(wù)已啟動(dòng) 。
  1. root@server1 [~]# systemctl start mysql
  2. root@server1 [~]#
  3. root@server1 [~]#
  4. root@server1 [~]# systemctl status mysql
  5. ● mysql.service - LSB: start and stop MySQL
  6. Loaded: loaded (/etc/rc.d/init.d/mysql)
  7. Active: active (exited) since Sun 2016-01-31 10:01:46 UTC; 3s ago
  8. Docs: man:systemd-sysv-generator(8)
  9. Process: 23717 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS)
  10. Main PID: 23430 (code=exited, status=203/EXEC)
  11. Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL...
  12. Jan 31 10:01:46 server1.centos7-test.com mysql[23717]: Starting MySQL SUCCESS!
  13. Jan 31 10:01:46 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL.

第5步:運(yùn)行命令 。
它將檢查所有數(shù)據(jù)庫中的所有表與當(dāng)前安裝的版本是否兼容,并在必要時(shí)會(huì)更新系統(tǒng)表 , 以賦予當(dāng)前版本新增加的權(quán)限或能力 。
  1. root@server1 [~]# mysql_upgrade
  2. MySQL upgrade detected
  3. Phase 1/6: Checking and upgrading mysql database
  4. Processing databases
  5. mysql
  6. mysql.columns_priv OK
  7. mysql.db OK
  8. mysql.event OK
  9. mysql.func OK
  10. mysql.help_category OK
  11. mysql.help_keyword OK
  12. mysql.help_relation OK
  13. mysql.help_topic OK
  14. mysql.host OK
  15. mysql.ndb_binlog_index OK
  16. mysql.plugin OK
  17. mysql.proc OK
  18. mysql.procs_priv OK
  19. mysql.proxies_priv OK
  20. mysql.servers OK
  21. mysql.tables_priv OK
  22. mysql.time_zone OK
  23. mysql.time_zone_leap_second OK
  24. mysql.time_zone_name OK
  25. mysql.time_zone_transition OK
  26. mysql.time_zone_transition_type OK
  27. mysql.user OK
  28. Phase 2/6: Fixing views from mysql
  29. Phase 3/6: Running 'mysql_fix_privilege_tables'
  30. Phase 4/6: Fixing table and database names
  31. Phase 5/6: Checking and upgrading tables
  32. Processing databases
  33. cphulkd
  34. cphulkd.auths OK
  35. cphulkd.blacklist OK
  36. cphulkd.brutes OK
  37. cphulkd.good_logins OK
  38. cphulkd.ip_lists OK
  39. cphulkd.known_netblocks OK
  40. cphulkd.login_track OK
  41. cphulkd.logins OK
  42. cphulkd.report OK
  43. cphulkd.whitelist OK
  44. eximstats
  45. eximstats.defers OK
  46. eximstats.failures OK
  47. eximstats.sends OK
  48. eximstats.smtp OK
  49. information_schema
  50. leechprotect
  51. leechprotect.hits OK
  52. modsec
  53. modsec.hits OK
  54. performance_schema
  55. roundcube
  56. roundcube.cache OK
  57. roundcube.cache_index OK
  58. roundcube.cache_messages OK
  59. roundcube.cache_shared OK
  60. roundcube.cache_thread OK
  61. roundcube.contactgroupmembers OK
  62. roundcube.contactgroups OK
  63. roundcube.contacts OK
  64. roundcube.cp_schema_version OK
  65. roundcube.dictionary OK
  66. roundcube.identities OK
  67. roundcube.searches OK
  68. roundcube.session OK
  69. roundcube.system OK
  70. roundcube.users OK
  71. saheetha_test
  72. saheetha_test.authors OK
  73. whmxfer
  74. whmxfer.sessions OK
  75. Phase 6/6: Running 'FLUSH PRIVILEGES'
  76. OK

第6步:再次重新啟動(dòng) MySQL 的服務(wù) , 以確保一切都運(yùn)行完好 。
  1. root@server1 [~]# systemctl restart mysql
  2. root@server1 [~]#
  3. root@server1 [~]# systemctl status mysql
  4. ● mysql.service - LSB: start and stop MySQL
  5. Loaded: loaded (/etc/rc.d/init.d/mysql)
  6. Active: active (running) since Sun 2016-01-31 10:04:11 UTC; 9s ago
  7. Docs: man:systemd-sysv-generator(8)
  8. Process: 23831 ExecStop=/etc/rc.d/init.d/mysql stop (code=exited, status=0/SUCCESS)
  9. Process: 23854 ExecStart=/etc/rc.d/init.d/mysql start (code=exited, status=0/SUCCESS)
  10. Main PID: 23430 (code=exited, status=203/EXEC)
  11. CGroup: /system.slice/mysql.service
  12. ├─23861 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --pid-file=/var/lib/mysql/server1.centos7-test.com.pid
  13. └─23933 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/v...
  14. Jan 31 10:04:10 server1.centos7-test.com systemd[1]: Starting LSB: start and stop MySQL...
  15. Jan 31 10:04:11 server1.centos7-test.com mysql[23854]: Starting MySQL. SUCCESS!
  16. Jan 31 10:04:11 server1.centos7-test.com systemd[1]: Started LSB: start and stop MySQL.

第7步:運(yùn)行 ,重建 /PHP 以支持,并確保所有 PHP 的模塊保持不變 。
  1. root@server1 [~]#/scripts/easyapache --build

重要
如果你在安裝之后忘記重建 /PHP,將會(huì)報(bào)如下庫錯(cuò)誤:
  1. root@server1 [/etc/my.cnf.d]# php -v
  2. php: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory

第8步:現(xiàn)在驗(yàn)證安裝的程序和數(shù)據(jù)庫 。
  1. root@server1 [/var/lib/mysql]# mysql
  2. Welcome to the MariaDB monitor. Commands end with ; or g.
  3. Your MariaDB connection id is 15
  4. Server version: 10.0.23-MariaDB MariaDB Server
  5. Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.
  6. Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
  7. MariaDB [(none)]> show storage engines;
  8. +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
  9. | Engine | Support | Comment | Transactions | XA | Savepoints |
  10. +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
  11. | CSV | YES | CSV storage engine | NO | NO | NO |
  12. | MRG_MyISAM | YES | Collection of identical MyISAM tables | NO | NO | NO |
  13. | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO |
  14. | BLACKHOLE | YES | /dev/ storage engine (anything you write to it disappears) | NO | NO | NO |
  15. | MyISAM | YES | MyISAM storage engine | NO | NO | NO |
  16. | InnoDB | DEFAULT | Percona-XtraDB, Supports transactions, row-level locking, and foreign keys | YES | YES | YES |
  17. | ARCHIVE | YES | Archive storage engine | NO | NO | NO |
  18. | FEDERATED | YES | FederatedX pluggable storage engine | YES | NO | YES |
  19. | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO |
  20. | Aria | YES | Crash-safe tables with MyISAM heritage | NO | NO | NO |
  21. +--------------------+---------+----------------------------------------------------------------------------+--------------+------+------------+
  22. 10 rows in set (0.00 sec)

就這樣 :) 。現(xiàn)在查看mysql服務(wù)安裝路徑,我們該去欣賞完善和高效的特點(diǎn)了 。希望你喜歡閱讀本文 。希望留下您寶貴的建議和反?。?
作者: [1] 譯者:[2] 校對:wxy[3]
本文由 LCTT[4] 原創(chuàng)編譯,Linux中國[5] 榮譽(yù)推出
[1]:
[2]:
[3]:
[4]:
[5]:
【在 CentOS 7 CPanel 服務(wù)器上安裝 MariaDB 10】本文到此結(jié)束,希望對大家有所幫助 。