久久精品人人爽,华人av在线,亚洲性视频网站,欧美专区一二三

MySQL的rpm安裝方式

153次閱讀
沒有評論

共計 5406 個字符,預計需要花費 14 分鐘才能閱讀完成。

本篇內容主要講解“MySQL 的 rpm 安裝方式”,感興趣的朋友不妨來看看。本文介紹的方法操作簡單快捷,實用性強。下面就讓丸趣 TV 小編來帶大家學習“MySQL 的 rpm 安裝方式”吧!

用于安裝 MySQL 的 rpm 包如下:

Table 2.6 RPM Packages for MySQL Community Edition

Package Name
Summary
mysql-community-server
Database server and related tools 數據庫服務器和相關工具
mysql-community-client
MySQL client applications and tools MySQL 客戶端應用程序和工具
mysql-community-common
Common files for server and client libraries 服務器和客戶端庫庫的通用文件
mysql-community-devel
Development header files and libraries for MySQL database client applications
mysql-community-libs
Shared libraries for MySQL database client applications
mysql-community-libs-compat
Shared compatibility libraries for previous MySQL installations
mysql-community-embedded
MySQL embedded library
mysql-community-embedded-devel
Development header files and libraries for MySQL as an embeddable library
mysql-community-test
Test suite for the MySQL server

Table 2.7 RPM Packages for the MySQL Enterprise Edition

Package Name
Summary
mysql-commercial-server
Database server and related tools
mysql-commercial-client
MySQL client applications and tools
mysql-commercial-common
Common files for server and client libraries
mysql-commercial-devel
Development header files and libraries for MySQL database client applications
mysql-commercial-libs
Shared libraries for MySQL database client applications
mysql-commercial-libs-compat
Shared compatibility libraries for previous MySQL installations
mysql-commercial-embedded
MySQL embedded library
mysql-commercial-embedded-devel
Development header files and libraries for MySQL as an embeddable library
mysql-commercial-test
Test suite for the MySQL server

rpm 包的語法格式:

packagename-version-distribution-arch.rpm

The distribution and arch values indicate the Linux distribution and the processor type for which the package was built. See the table below for lists of the distribution identifiers:

Table 2.8 MySQL Linux RPM Package Distribution Identifiers

distribution Value
Intended Use
el5, el6, el7
Red Hat Enterprise Linux/Oracle Linux/CentOS 5, 6, or 7
fc22, fc23
Fedora 22 or 23
sles12
SUSE Linux Enterprise Server 12

查看 rpm 包中所有文件 (for example, mysql-community-server):

shell rpm -qpl mysql-community-server-version-distribution-arch.rpm

本章剩余章節只適合從 Oracle 下載的包的安裝過程,不適用于 MySQL 庫的安裝。

包中存在一些依賴關系。如果你打算安裝好幾個包,你應該選擇下載 tar 格式的 rpm 包群,包群里包含了上述所有包,如此一來你便不用分別下載它們。

大多數情況下,你需要安裝 mysql-community-server, mysql-community-client, mysql-community-libs, mysql-community-common, and mysql-community-libs-compat 這五個包來得到一個可用的、標準的 MySQL 系統。要執行這樣一個標準的、最小化的安裝,切換到這些包所在的文件夾的路徑,在除了 Red Hat Enterprise Linux/Oracle Linux/CentOS 5 平臺下執行如下命令:

shell sudo yum install mysql-community-{server,client,common,libs}-*

Replace yum with zypper for SLES systems, and with dnf for dnf-enabled systems (like Fedora 22).

對于 Red Hat Enterprise Linux/Oracle Linux/CentOS 5 平臺,有一個額外的包需要安裝:mysql-version-el5-arch.rpm,使用如下命令:

shell sudo yum install mysql-community-{server,client,common,libs}-* mysql-5.*

盡管使用一個高級的包管理工具例如 yum 來安裝包會是極佳的選擇,但是仍有用戶喜歡直接使用 rpm 的命令 rpm -Uvh 來安裝,這種方式會增加失敗的風險,因為可能會遇到潛在的依賴包的問題。

To install only the client programs, you can skip mysql-community-server in your list of packages to install; issue the following command for platforms other than Red Hat Enterprise Linux/Oracle Linux/CentOS 5:

shell sudo yum install mysql-community-{client,common,libs}-*

Replace yum with zypper for SLES systems, and with dnf for dnf-enabled systems (like Fedora 22).

For Red Hat Enterprise Linux/Oracle Linux/CentOS 5 systems:

shell sudo yum install mysql-community-{client,common,libs}-* mysql-5.*

A standard installation of MySQL using the RPM packages result in files and resources created under the system directories, shown in the following table.

MySQL 安裝的默認布局如下:

Table 2.9 MySQL Installation Layout for Linux RPM Packages from the MySQL Developer Zone

Files or Resources
Location
Client programs and scripts
/usr/bin
mysqld server
/usr/sbin
Configuration file
/etc/my.cnf
Data directory
/var/lib/mysql
Error log file
For RHEL, Oracle Linux, CentOS or Fedora platforms: /var/log/mysqld.log
For SLES: /var/log/mysql/mysqld.log
Value of secure_file_priv
/var/lib/mysql-files
System V init script
For RHEL, Oracle Linux, CentOS or Fedora platforms: /etc/init.d/mysqld
For SLES: /etc/init.d/mysql
Systemd service
For RHEL, Oracle Linux, CentOS or Fedora platforms: mysqld
For SLES: mysql
Pid file
/var/run/mysql/mysqld.pid
Socket
/var/lib/mysql/mysql.sock
Keyring directory
/var/lib/mysql-keyring
Unix manual pages
/usr/share/man
Include (header) files
/usr/include/mysql
Libraries
/usr/lib/mysql
Miscellaneous support files (for example, error messages, and character set files)
/usr/share/mysql

安裝同時會在操作系統上創建一個名為 mysql 的用戶和一個名為 mysql 的組。

Note

使用舊的安裝包來安裝原來的版本的 MySQL 可能會創建一個叫做 /usr/my.cnf 的配置文件。強烈建議您檢查該文件的內容并將有用的設置遷移到文件 /etc/my.cnf 中,然后移除 /usr/my.cnf。

在安裝過程的最后,MySQL 并不會自動啟動。對于 Red Hat Enterprise Linux, Oracle Linux, CentOS, and Fedora systems, 使用如下命令啟動 MySQL:

shell sudo service mysqld start

對于 For SLES systems, 命令一樣,但是服務名不同:

shell sudo service mysql start

如果操作系統啟用了 systemd,那么標準的 service 命令例如 stop,start,status 以及 restart 都應該可以用來管理 MySQL 服務器的服務。mysqld 服務默認開啟,并跟隨系統啟動。注意,有些事情在 systemd 平臺上會表現的不一致:例如,改變數據目錄的位置可能會產生問題。

At the initial start up of the server, the following happens, given that the data directory of the server is empty:

在服務器初始化啟動階段,會發生下列事情,前提是該服務器的數據目錄沒數據:

服務器初始化。

一個 SSL 證書和密鑰文件在數據目錄中產生。

validate_password plugin 插件安裝并生效。

一個超級用戶帳號 root @ localhost 創建。該超級用戶的密碼已設置并存儲在錯誤日志文件中。要找到它,RHEL, Oracle Linux, CentOS, and Fedora systems 使用如下命令:

shell sudo grep temporary password /var/log/mysqld.log

Use the following command for SLES systems:

shell sudo grep temporary password /var/log/mysql/mysqld.log

接下來是利用剛生成的臨時密碼登錄數據庫并為該超級用戶帳號設置一個典型的密碼:

shell mysql -uroot -p

mysql ALTER USER root @ localhost IDENTIFIED BY MyNewPass4!

Note

MySQL 默認安裝  validate_password 插件。該插件要求密碼包含至少一個大寫字母,一個小寫字母,一個數字以及一個特殊字符,同時密碼長度至少 8 位。

如果安裝過程中出現錯誤,你可以去錯誤日志文件 /var/log/mysqld.log 查找相關信息。對于某些 Linux 平臺,有必要提高對 mysqld 可用的文件描述符的限制。

到此,相信大家對“MySQL 的 rpm 安裝方式”有了更深的了解,不妨來實際操作一番吧!這里是丸趣 TV 網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!

正文完
 
丸趣
版權聲明:本站原創文章,由 丸趣 2023-08-01發表,共計5406字。
轉載說明:除特殊說明外本站除技術相關以外文章皆由網絡搜集發布,轉載請注明出處。
評論(沒有評論)
主站蜘蛛池模板: 赣榆县| 盐边县| 南木林县| 崇左市| 八宿县| 宁化县| 房山区| 漳浦县| 兰西县| 涞源县| 隆安县| 如东县| 阿荣旗| 屏山县| 杭州市| 页游| 尖扎县| 津南区| 苍梧县| 福清市| 云林县| 濮阳县| 区。| 武城县| 富宁县| 辽宁省| 莆田市| 会昌县| 泸溪县| 堆龙德庆县| 龙州县| 汨罗市| 西充县| 株洲县| 石城县| 公主岭市| 庆安县| 天峨县| 恩施市| 保定市| 大关县|