Home > Database > Mysql Tutorial > body text

inux下安装mysql

WBOY
Release: 2016-06-01 13:13:11
Original
888 people have browsed it

inux下mysql 最新版安装图解教程

1、查看当前安装的linux版本

命令:lsb_release -a 如下图所示

通过上图中的数据可以看出安装的版本为RedHat5.4,所以我们需要下载RedHat5.4对应的mysql安装包

2、下载mysql安装文件

 官方网站下载安装包,因为本地RedHat版本为Red Hat 5.4,操作系统是64位的
 所以在官方网站下载以下安装包http://dev.mysql.com/downloads/mysql#downloads
 MySQL-server-5.5.25a-1.rhel5.x86_64
 MySQL-client-5.5.25a-1.rhel5.x86_64
 MySQL-devel-5.5.25a-1.rhel5.x86_64

3、安装mysql

1、进入安装文件的目录

2、安装mysql服务端

rpm -ivh MySQL-server-5.5.25a-1.rhel5.x86_64.rpm

如图:mysql-server安装

 3、安装mysql客户端、mysql-devel

rpm -ivh MySQL-client-5.5.25a-1.rhel5.x86_64.rpm
rpm -ivh MySQL-devel-5.5.25a-1.rhel5.x86_64.rpm

如图:mysql-client-devel

启动mysql服务

4、修改mysql中root的初始化密码

1、命令如下:

# /usr/bin/mysqladmin -u root password ‘rootadmin’

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

2、例子

# /usr/bin/mysqladmin -u root password ‘rootadmin’

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

3、用新的密码进行登录,如下图所示:

5、重启与停止mysql服务

 启动方式1:service mysql start
 启动方式2:/etc/init.d/mysql start
 停止方式1:service mysql stop
 停止方式2:/etc/init.d/mysql shutdown
 重启方式1:service mysql restart
 重启方式2:/etc/init.d/mysql restart

原文地址:http://blog.itblood.com/under-linux-mysql-latest-version-installation-diagram-tutorial.html

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!