參考自 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 updatechkconfig --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.完成
沒有留言:
張貼留言