在Linux上安装MySQL推荐的方法是使用一个RPM文件。MySQL RPM目前是在一个
RedHat 5.2 系统上建立的,但是应该能工作在支持rpm且使用glibc的其他 Linux 版本上。
如果一个RPM文件有问题,例如Sorry, the host 'xxxx' could not be looked up,
你可能要使用的RPM文件有:
1 MySQL-VERSION.i386.rpm MySQL服务器。除非你只是想要与运行在其他机器上MySQL 服务器连接,否则你将需要它。
2 MySQL-client-VERSION.i386.rpm 标准MySQL客户程序。你可能总是需要安装这个包。
3 MySQL-bench-VERSION.i386.rpm 测试和基准程序。需要Perl和msql-mysql-modules RPM。
4 MySQL-devel-VERSION.i386.rpm 所需的库和包含文件。如果你想要编译其他MySQL客户 程序, 例如Perl模块。
5 MySQL-VERSION.src.rpm 包含上述所有包的源代码。它也能被用来尝试为其他硬件平台构造RPM(例如,Alpha或SPARC)。
查看一个RPM包中的所有文件:
shell> rpm - qpl MySQL-VERSION.i386.rpm
实施一个标准的最小安装,运行这个命令:
shell> rpm -i MySQL-VERSION.i386.rpm MySQL-client-VERSION.i386.rpm
只安装客户包:
shell> rpm -i MySQL-client-VERSION.i386.rpm
RPM将数据放在“/var/lib/mysql”里,RPM也在“/etc/rc.d/”里创建适当的入
口以便在引导时自动启动服务器。(这意味着如果你以前已经安装过,在对它改变之前,你可以把你以前安装的MySQL启动文件做个拷贝,因此你不会丢失改动)。
在安装了RPM文件后,“mysqld”守护程序应该正在运行,并且现在你应该可以开始使用MySQL
(以下是英文介绍)
In most cases, you only need to install the MySQL-server and MySQL-client packages to get a functional MySQL installation. The other packages are not required for a standard installation. If you want to run a MySQL-Max server that has additional capabilities, you should also install the MySQL-Max RPM. However, you should do so only after installing the MySQL-server RPM.
If you get a dependency failure when trying to install the MySQL 4.0 packages (for example, ``error: removing these packages would break dependencies: libmysqlclient.so.10 is needed by ...''), you should also install the package MySQL-shared-compat, which includes both the shared libraries for backward compatibility (libmysqlclient.so.12 for MySQL 4.0 and libmysqlclient.so.10 for MySQL 3.23).
The following RPM packages are available:
MySQL-server-VERSION.i386.rpm The MySQL server. You will need this unless you only want to connect to a MySQL server running on another machine. Note: Server RPM files were called MySQL-VERSION.i386.rpm before MySQL 4.0.10. That is, they did not have -server in the name.
MySQL-Max-VERSION.i386.rpm The MySQL-Max server. This server has additional capabilities that the one provided in the MySQL-server RPM does not. You must install the MySQL-server RPM first, because the MySQL-Max RPM depends on it.
MySQL-client-VERSION.i386.rpm The standard MySQL client programs. You probably always want to install this package.
MySQL-bench-VERSION.i386.rpm Tests and benchmarks. Requires Perl and the DBD::mysql module.
MySQL-devel-VERSION.i386.rpm The libraries and include files that are needed if you want to compile other MySQL clients, such as the Perl modules.
MySQL-shared-VERSION.i386.rpm This package contains the shared libraries (libmysqlclient.so*) that certain languages and applications need to dynamically load and use MySQL.
MySQL-shared-compat-VERSION.i386.rpm This package includes the shared libraries for both MySQL 3.23 and MySQL 4.0. Install this package instead of MySQL-shared if you have applications installed that are dynamically linked against MySQL 3.23 but you want to upgrade to MySQL 4.0 without breaking the library dependencies. This package has been available since MySQL 4.0.13.
MySQL-embedded-VERSION.i386.rpm The embedded MySQL server library (from MySQL 4.0).
MySQL-VERSION.src.rpm This contains the source code for all of the previous packages. It can also be used to rebuild the RPMs on other architectures (for example, Alpha or SPARC).
在大多数情况下,你只需要安装MySQL-server和MySQL-client得到一个功能MySQL软件包安装。另一个包是不需要一个标准的安装。如果你想开办一个MySQL-Max服务器,有更多的能力,你也应该安装MySQL-Max每分钟转速。但是,你应该这样做的只是在安装MySQL-server每分钟转速。
如果你得到一个依赖的失败尝试安装MySQL 4.0软件(例如,“错误:移除这些包裹将打破依赖性:libmysqlclient.so。10需要……”),那么你也应该安装包,它包括MySQL-shared-compat共享库(libmysqlclient.so向后兼容性。12 libmysqlclient.so MySQL 4.0。10 MySQL 3.23)。
下面的RPM格式的软件包可供选择:
MySQL-server-VERSION.i386。rpm的MySQL服务器。你需要这样,除非你只是想连接到一个MySQL服务器运行在另一台机器上。注意:服务器文件被称为MySQL-VERSION.i386转速。前4.0.10转0。也就是说,他们没有-服务器名称。
MySQL-Max-VERSION.i386。MySQL-Max rpm的服务器。这个服务器有额外的能力,这一规定不MySQL-server转速。你必须安装MySQL-server RPM第一,因为MySQL-Max RPM取决于它。
MySQL-client-VERSION.i386。标准的MySQL客户转程序。你可能永远要安装这个包裹。
MySQL-bench-VERSION.i386。每分钟转速测试和基准。需要Perl和差的:mysql模块。
MySQL-devel-VERSION.i386。rpm图书馆和包含文件,如果你想编写需要其他MySQL的客户,如Perl模块。
MySQL-shared-VERSION.i386。这个包包含了rpm共享库(libmysqlclient.so *),某些语言和应用程序需要动态装载和使用MySQL。
MySQL-shared-compat-VERSION.i386。这个包包括了rpm共享库都3.23和MySQL MySQL 4.0。安装这个包裹,而不是MySQL-shared如果你安装应用动态链接攻击,但你需要MySQL 3.23升级到MySQL 4.0没有打破这个图书馆的附庸。这个包裹已经问世以来4.0.13 MySQL的。
MySQL-embedded-VERSION.i386。rpm嵌入式MySQL服务器库(从MySQL 4.0)。
MySQL-VERSION.src。这包含转速的源码,所有以前的包装。它也可以被用来重建的rpm软件将在其他体系结构(例如,阿尔法或SPARC)。