Home > Database > Mysql Tutorial > body text

MySQL 5.5 for Linux 安装

WBOY
Release: 2016-06-07 17:09:55
Original
932 people have browsed it

下载地址: http://dev.mysql.com/downloads/mysql/5.5.html#downloads 进入后会有选择系统 选择linux-generic后 又有很多产品选

下载地址: #downloads

进入后会有选择系统


选择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


下载完成后得到:


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

如: 

> 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旧密码一项就可以省略了。

linux

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template