redhat AS4 下MYSQL 5.0的安装
卸载旧版m y s q l
我们要学会用rpm -qa 这个命令,查询我们安装过的相应的mysql的RPM,然后把这些包一个一个的卸掉
[root@localhost f]# rpm -qa | grep mysql
mysql-4.1.12-3.RHEL4.1
卸载过程:是从最下面的一个包开始,因为有些东西是有顺序的。方法是:
[root@svnserver]# rpm mysql-4.1.12-3.RHEL4.1
如果在卸载mysql-devel出现如下的错误:
[root@localhost f]# rpm -e mysql-4.1.12-3.RHEL4.1
error: Failed dependencies:
libmysqlclient.so.14 is needed by (installed) cyrus-sasl-sql-2.1.19-5.EL4.i386
libmysqlclient.so.14 is needed by (installed) dovecot-0.99.11-2.EL4.1.i386
那么,你需要按倒序来先删除dovecot-0.99.11-2.EL4.1.i386,然后是cyrus-sasl-sql-2.1.19-5.EL4.i386,最后,你可以完全删除mysql-devel,其他的类似。
[root@localhost f]# rpm -e dovecot-0.99.11-2.EL4.1.i386
[root@localhost f]# rpm -e cyrus-sasl-sql-2.1.19-5.EL4.i386
开始卸载
[root@localhost f]# rpm -e mysql-4.1.12-3.RHEL4.1
安装MYSQL
[root@localhost f]# rpm -i MySQL-server-community-5.0.45-0.rhel4.i386.rpm
[root@localhost f]# rpm -i MySQL-client-community-5.0.45-0.rhel4.i386.rpm
[root@localhost f]# mysqladmin -u root password '123456'
完成。
[root@localhost f]# rpm -i MySQL-server-community-5.0.51a-0.rhel4.i386.rpm
rpm -i MySQL-server-community-5.0.51a-0.rhel4.i386.rpm
warning: MySQL-server-community-5.0.51a-0.rhel4.i386.rpm: V3 DSA signature: NOKEY, key ID 5072e1f5
PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:
/usr/bin/mysqladmin -u root password 'new-password'
/usr/bin/mysqladmin -u root -h localhost.localdomain password 'new-password'
Alternatively you can run:
/usr/bin/mysql_secure_installation
which will also give you the option of removing the test
databases and anonymous user created by default. This is
strongly recommended for production servers.
See the manual for more instructions.
Please report any problems with the /usr/bin/mysqlbug script!
The latest information about MySQL is available on the web at
http://www.mysql.com
Support MySQL by buying support/licenses at http://shop.mysql.com
Notes regarding SELinux on this platform:
=========================================
The default policy might cause server startup to fail because it is
not allowed to access critical files. In this case, please update
your installation.
The default policy might also cause inavailability of SSL related
features because the server is not allowed to access /dev/random
and /dev/urandom. If this is a problem, please do the following:
1) install selinux-policy-targeted-sources from your OS vendor
2) add the following two lines to /etc/selinux/targeted/src/policy/domains/program/mysqld.te:
allow mysqld_t random_device_t:chr_file read;
allow mysqld_t urandom_device_t:chr_file read;
3) cd to /etc/selinux/targeted/src/policy and issue the following command:
make load