1,根据服务器情况下载server rpm和client rpm 下载地址http://dev.mysql.com/downloads/mysql/5.1.html
2,linux下执行rpm -ivh MySQL-server-community-5.1.58-1.rhel5.x86_64.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 tc_132_16 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!
Starting MySQL.[ OK ]
Giving mysqld 2 seconds to start
netstat -nat
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN
mysql服务已经启动
有冲突报请使用rpm -e --nodeps mysql-libs-5.1.52-1.el6_0.1.x86_64先卸载在安装。
3 ,安装客户端,执行 rpm -ivh MySQL-client-community-5.1.58-1.rhel5.x86_64.rpm
Preparing... ########################################### [100%]
1:MySQL-client-community ########################################### [100%]
执行mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.58-community MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>
安装成功
4, 默认mysql安装完成后是没有密码的,
执行usr/bin/mysqladmin -u root password 'newpassword'
修改密码
连接mysql -uroot -pnewpassword
成功
安装mysql完成
重启mysql可以通过service mysqld restart完成