顯示具有 Linux 標籤的文章。 顯示所有文章
顯示具有 Linux 標籤的文章。 顯示所有文章

2013年8月16日 星期五

RedHat el5 安裝Mysql5.5

參考自 http://stackoverflow.com/questions/9361720/update-mysql-version-from-5-1-to-5-5-in-centos-6-2

節錄內容

To list Old MySql

yum list installed | grep -i mysql

To remove Old MySql

yum remove mysql mysql-*

Remi Dependency on CentOS 6 and Red Hat (RHEL) 6

rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm

Install MySQL server

yum --enablerepo=remi,remi-test install mysql mysql-server

To list New MySql

yum list installed | grep -i mysql

start MySql server


/etc/init.d/mysqld start ## use restart after update

OR


service mysqld start ## use restart after update
chkconfig --levels 235 mysqld on

Last

mysql_upgrade

Now my MySql version is 5.5.32

Ref:


http://www.webtatic.com/packages/mysql55/
http://www.if-not-true-then-false.com/2010/install-mysql-on-fedora-centos-red-hat-rhel/
 
------------------------------
我下的指令
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
rpm –Uvh http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
yum --enablerepo=remi,remi-test install mysql mysql-server
/etc/init.d/mysqld
這樣就裝好了, 裝好Mysql後記得去更新password
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h vdb password 'new-password'

或者
/usr/bin/mysql_secure_installation



因為要建立一個DB並從另一台主機連線.
#mysql -u root -p
建一個資料庫
CREATE DATABASE mydatabase DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;

給外部連線權限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'連線主機IP ' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON ‘%`.* TO 'root'@'連線主機IP ' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `%`.* TO `root`@`連線主機IP` IDENTIFIED BY 'password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON moodle.* TO 'root'@'連線主機IP' IDENTIFIED BY 'password' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON moodle.* TO 'root'@'連線主機IP' IDENTIFIED BY 'password' WITH GRANT OPTION;
(忘了是哪一個,所以全部貼上)

 done.完成












2013年8月9日 星期五

VM RHEL 5 安裝 yum 的過程

因為RHEL 5新安裝後, 出現
This system is not registered with RHN.
RHN support will be disabled.

第一步請先檢查你的RedHat的DNS解析是否有問題!! 如果不行再繼續往下.

沒有去處理官方的要求, 如果你有原版序號, 大概沒有這個問題, 因為這台沒有, 所以直接換成centos的yum組件.


0先檢查 /etc/yum.repos.d/rhel-debuginfo.repo 這個檔案,

原來的內容是:
[rhel-debuginfo]
name=Red Hat Enterprise Linux $releasever - $basearch - Debug
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/$basearch/Debuginfo/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

我有把repo檔的內容載下來, 新的repo內容在最下面

注意,如果你的yum 可以 更新, eg: #yum update 可以執行, 下面的步驟就不用執行了


 1.卸载redhat的yum组件

# rpm -qa | grep yum | xargs rpm -e --nodeps

2.下載yum*.rpm 

到 rpm.pbone.net 這個網頁
eg:

(建了一個臨時的/usr/scource 下載需要的 rpm )
wget ftp://ftp.univie.ac.at/systems/linux/dag/redhat/el5/en/ppc/fabian/RPMS/yum-2.4.2-0.4.el5.rf.noarch.rpm

3.  安裝rpm

rpm -ivh yum-2.4.2-0.4.el5.rf.noarch.rpm
yum就正常可以使用了(版本2.4.2)

4.  更新yum

#yum install yum
更新到最新版

PS:補充 rhel-debuginfo.repo的內容 (來源 http://docs.linuxtone.org/soft/lemp/CentOS-Base.repo )
rhel-debuginfo.repo