CentOS下以RPM方式安裝MySQL5.5資料庫(1/2)

來源:互聯網
上載者:User

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

首頁 1 2 末頁
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.