软件测试 | 在Linux平台下安装MySQL
  p1prOQge3cDY 2023年11月02日 48 0

在 Linux 平台下安装和 Windows 平台有所不同,不能用图形化的方式来安装,并且在 Linux 下支持 3 种安装方式:RPM 包、二进制包、源码包。下面以 RPM 包为例来介绍如何在 Linux 平台下进行 MySQL 的安装,其他安装方式还会在本书第 4 篇的第 24 章中进行详细介绍。

RPM 是 Redhat Package Manage 的缩写,透过 RPM 的管理,使用者可以把 Source Code 包装 成一种 Source 和 Binary 的档案形式,更加便于安装。MySQL 的 RPM 包包括很多套件,一般 只安装 Server 和 Client 就可以了。其中 Server 包是 MySQL 服务端套件,为用户提供核心的 MySQL 服务;Client 包是连接 MySQL 服务的客户端工具,方便管理员和开发人员在服务器 上进行各种管理工作。

安装 RPM 包的具体操作步骤如下。

(1)切换到 root 下(只有 root 才可以执行 RPM 包):

[zzx@bj52 zzx]$ su 
Password: 
[root@bj52 zzx]#

(2)安装MySQL Server包:

[root@localhost zzx]# rpm -ivh MySQL-server-community-5.0.45-0.rhel3.i386.rpm 
warning: MySQL-server-community-5.0.45-0.rhel3.i386.rpm: V3 DSA signature: NOKEY, key ID 
5072e1f5 
Preparing... ########################################### [100%] 
 1:MySQL-server-community ########################################### [100%] 
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands: 
/usr/bin/mysqladmin -u root password 'new-password' 
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password' 
See the manual for more instructions. 
Please report any problems with the /usr/bin/mysqlbug script! 
The latest information about MySQL is available on the web at 
http://www.mysql.com 
Support MySQL by buying support/licenses at http://shop.mysql.com 
Starting MySQL[ OK ]

(3)安装MySQL client包:

[root@localhost zzx]# rpm -ivh MySQL-client-community-5.0.45-0.rhel3.i386.rpm 
warning: MySQL-client-community-5.0.45-0.rhel3.i386.rpm: V3 DSA signature: NOKEY, key ID 
5072e1f5 
Preparing... ########################################### [100%] 
 1:MySQL-client-community ########################################### [100%]

(4)最后运行MySQL:

[root@localhost zzx]# mysql -uroot 
Welcome to the MySQL monitor. Commands end with ; or \g. 
Your MySQL connection id is 2 
Server version: 5.0.45-community MySQL Community Edition (GPL) 
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. 
mysql>

至此,MySQL安装完毕。

注意:在 Server 安装过程中有时候会提示缺少 perl-DBI-1.40-8.i386.rpm,这时就需要先下载一个进行安装包,下载地址为 ftp://ftp.chg.ru/pub/Linux/scientific/43/i386/SL/RPMS/perl-DBI-1.40-8.i386.rpm。

【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  20xfzlOvosRH   2023年12月05日   29   0   0 mysql数据库
p1prOQge3cDY
最新推荐 更多