yum/rpm包卸载和安装

JDK example:

0. Remove jdk1.4.2 if exist
rpm -qa | grep jdk
rpm -qa | grep gcj  (list the installed jdk)
yum -y remove java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
1. Download jdk-6u45-linux-i586.bin from http://www.oracle.com/technetwork/java/javasebusiness/downloads
2. mkdir /usr/developer, copy bin file to this folder
3. Go to jdk folder path in terminal
4. chmod 755 jdk-6u45-linux-i586.bin
5. ./jdk-6u45-linux-i586.bin
6. vim /etc/profile
#set java environment
JAVA_HOME=/usr/developer/jdk1.6.0_45
CLASSPATH=$JAVA_HOME/lib:$JAVA_HOME/jre/lib
PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
export JAVA_HOME CLASSPATH PATH
7. source /etc/profile

Mysql example:
1. 检查是否有已经安装的mysql的rpm
rpm -qa | grep -i mysql
2. 如果有的话, 删除已经安装的mysql的rpm, xxx为第一步中搜到的.
rpm -e --nodeps xxx
3. Download server and client RPMs from http://dev.mysql.com/downloads/mysql/#downloads
包含server和client两个,注意支持的操作系统版本, 下面是支持CentOS6 32bit的.
MySQL-server-5.6.14-1.el6.i686.rpm
MySQL-client-5.6.14-1.el6.i686.rpm
4. Install MySQL server and client
rpm -ivh MySQL-server-5.6.14-1.el6.i686.rpm
rpm -ivh MySQL-client-5.6.14-1.el6.i686.rpm
5. Start MySQL service
service mysql start
5.1 Check mysql status
netstat -natpl
3306 port is listed, means it starts successfully.
6. Log in MySQL by client
get the password in /root/.mysql_secret
mysql -uroot -p
input the temp password in /root/.mysql_secret, xxx为新密码.
set password=password('xxx');
set password before execute other statement.
7. Add remote access, 看情况而定这部的设置
GRANT ALL PRIVILEGES ON *.* to root@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
FLUSH PRIVILEGES;
*.* means all databases and the tables, the first root is the user name, the second root is the password, % means all remote client can access.
select Host,User from user
check the % is listed in Host for user root.

你可能感兴趣的:(centos)