Select Platform 選擇 Oracle & Red Hat Linux 4 & 5
分別下載以下三個檔案(由於我的機器是32位,下面是32位版本的包,如果你的機器是64位的請下載64位版本):
1. Red Hat & Oracle Linux 5 (x86, 32-bit), RPM Package
MySQL Server
2. Red Hat & Oracle Linux 5 (x86, 32-bit), RPM Package
Client Utilities
3. Red Hat & Oracle Linux 5 (x86, 32-bit), RPM Package
Development Libraries
使用wget命令使用斷點傳輸的方式將這三個檔案下載
代碼如下 |
複製代碼 |
wget -c http://cdn.mysql.com/Downloads/MySQL-5.5/MySQL-server-5.5.28-1.rhel5.i386.rpm wget -c http://cdn.mysql.com/Downloads/MySQL-5.5/MySQL-client-5.5.28-1.rhel5.i386.rpm wget -c http://cdn.mysql.com/Downloads/MySQL-5.5/MySQL-devel-5.5.28-1.rhel5.i386.rpm |
下載完成後開始安裝:
代碼如下 |
複製代碼 |
rpm -ivh MySQL-server-5.5.28-1.rhel5.i386.rpm rpm -ivh MySQL-client-5.5.28-1.rhel5.i386.rpm rpm -ivh MySQL-devel-5.5.28-1.rhel5.i386.rpm |
如果安裝途中出錯:
代碼如下 |
複製代碼 |
error: Failed dependencies: libaio.so.1()(64bit) is needed by MySQL-server-5.5.28-1.rhel5.x86_64 libaio.so.1(LIBAIO_0.1)(64bit) is needed by MySQL-server-5.5.28-1.rhel5.x86_64 libaio.so.1(LIBAIO_0.4)(64bit) is needed by MySQL-server-5.5.28-1.rhel5.x86_64 |
是依賴庫缺少,安裝依賴庫即可
代碼如下 |
複製代碼 |
yum install libaio |
提示安裝完成後,輸入mysql 看是否安裝成功
mysql
如果沒有反應或者出現如下錯誤資訊:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
說明mysql服務還沒有啟動,輸入service mysql start啟動mysql服務
service mysql start
然後再輸入mysql,若出現以下提示資訊,說明成功。
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.5.16 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered www.111cn.net trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
如果出現錯誤
Starting MySQL.... ERROR! The server quit without updating PID file (/var/lib/mysql/lechiexxxxx.pid).
根據錯誤地址 查看記錄檔
這裡的地址是 /var/lib/mysql/
日誌名稱一般為 伺服器名.err