下载地址: http://dev.​​mysql​​.com/downloads/mysql/5.5.html#downloads

进入后会有选择​​系统​

mysql5.5 for linux 安装(转)_mysql

选择linux-generic后 又有很多产品选择,我们只下载以下2个就可以了

server:

Linux - Generic 2.6 (x86, 32-bit), RPM Package MySQL Server 5.5.20 48.9M

​Download​

(MySQL-server-5.5.20-1.linux2.6.i386.rpm) MD5: ​​517e95a5d9ecc6d0f171dfbdfb9e62fb​

 

client: 

Linux - Generic 2.6 (x86, 32-bit), RPM Package
Client Utilities
 5.5.20 16.2M

​Download​

(MySQL-client-5.5.20-1.linux2.6.i386.rpm) MD5: ​​3aca3154617e6457e7a08eaf41c43a7a​

 

 

下载完成后得到:

mysql5.5 for linux 安装(转)_下载地址_02

进入下载文件所以目录进行安装

如: 

> rpm -ivh MySQL-server-5.5.20-1.linux2.6.i385.rpm

> rpm -ivh MySQL-client-5.5.20-1.linux2.6.i385.rpmp

启动mysql

> service mysql start

 

登录MySQL的命令是mysql, mysql 的使用语法如下:

  mysql [-u username] [-h host] [-p[password]] [dbname]

  username 与 password 分别是 MySQL 的用户名与密码,mysql的初始管理帐号是root,没有密码,注意:这个root用户不是Linux的系统用户。MySQL默认用户是root,由于初始没有密码,第一次进时只需键入mysql即可。

然后输入mysql

root@test1 local]# mysql

  Welcome to the MySQL monitor. Commands end with ; or \g.

  Your MySQL connection id is 1 to server version: 4.0.16-standard

  Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

  mysql>

出现了“mysql>”提示符,恭喜你,安装成功!

修改登录密码

 

  MySQL默认没有密码,安装完毕增​​加密​​码的重要性是不言而喻的。

  1、命令

  usr/bin/mysqladmin -u root password 'new-password'

  格式:mysqladmin -u用户名 -p旧密码 password 新密码 

 

键入以下命令 :

  [root@test1 local]# /usr/bin/mysqladmin -u root password 123456

  注:因为开始时root没有密码,所以-p旧密码一项就可以省略了