安装MySQL

昨日,在CentOS5.7下安装MySQL5.0.92,微笑安装成功。

系统环境:

旧mysql版本:mysql-5.0.77-4.el5_6.6

新mysql版本:

MySQL-server-community-5.0.92-1.rhel5.i386.rpm

MySQL-client-community-5.0.92-1.rhel5.i386.rpm

现把安装过程分享给诸位!

一、停掉mysqld服务

# service mysqld stop

二、卸载

1.找出所有的MySQL版本包,然后一个个卸掉.

[root@localhost /]# rpm -qa | grep -i mysql

2.找出含有mysql的所有文件夹和文件

[root@localhost /]# find / -name mysql

然后把找到的目录删除.

三、安装

1.安装Server

[root@localhost tmp]# rpm -ivh MySQL-server-community-5.0.92-1.rhel5.i386.rpm

2.安装Client

[root@localhost tmp]# rpm -ivh MySQL-client-community-5.0.92-1.rhel5.i386.rpm

完毕。


附:

安装日志

[xiaobin@localhost tmp]$ su - root
口令:
[root@localhost ~]# cd /
[root@localhost /]# cd tmp
[root@localhost tmp]# rpm -qa | grep -i mysql
mysql-server-5.0.77-4.el5_6.6
mysql-5.0.77-4.el5_6.6
perl-DBD-MySQL-3.0007-2.el5
[root@localhost tmp]# rpm -ev mysql-server-5.0.77-4.el5_6.6
warning: /var/log/mysqld.log saved as /var/log/mysqld.log.rpmsave
[root@localhost tmp]# rpm -ev mysql-5.0.77-4.el5_6.6
error: Failed dependencies:
        libmysqlclient.so.15 is needed by (installed) perl-DBD-MySQL-3.0007-2.el5.i386
        libmysqlclient.so.15(libmysqlclient_15) is needed by (installed) perl-DBD-MySQL-3.0007-2.el5.i386
[root@localhost tmp]# rpm -ev perl-DBD-MySQL-3.0007-2.el5
[root@localhost tmp]# rpm -ev mysql-5.0.77-4.el5_6.6
[root@localhost tmp]# find / -name mysql
/var/lib/mysql
/var/lib/mysql/mysql
[root@localhost tmp]# sudo rm -r /var/lib/mysql
[root@localhost tmp]# rpm -qa | grep -i mysql
[root@localhost tmp]# rpm -ivh MySQL-server-community-5.0.92-1.rhel5.i386.rpm
Preparing...                ########################################### [100%]
   1:MySQL-server-community ########################################### [100%]
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
Starting MySQL.[确定]
Giving mysqld 2 seconds to start
[root@localhost tmp]# rpm -ivh MySQL-client-community-5.0.92-1.rhel5.i386.rpm
Preparing...                ########################################### [100%]
   1:MySQL-client-community ########################################### [100%]
[root@localhost tmp]# mysql -V
mysql  Ver 14.12 Distrib 5.0.92, for pc-linux-gnu (i686) using readline 5.1
[root@localhost tmp]# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.0.92-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema | 
| mysql              | 
| test               | 
+--------------------+
3 rows in set (0.00 sec)

mysql> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值