linux下MySQL安装(rpm)

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完成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值