写点什么

软件测试 | 在 Linux 平台下安装 MySQL

  • 2023-07-21
    北京
  • 本文字数:1232 字

    阅读完需:约 4 分钟

更多测试资料戳!!!

在 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。

用户头像

社区:ceshiren.com 微信:ceshiren2023 2022-08-29 加入

微信公众号:霍格沃兹测试开发 提供性能测试、自动化测试、测试开发等资料、实事更新一线互联网大厂测试岗位内推需求,共享测试行业动态及资讯,更可零距离接触众多业内大佬

评论

发布
暂无评论
软件测试 | 在Linux平台下安装MySQL_测试_测吧(北京)科技有限公司_InfoQ写作社区