Blogger Information
Blog 29
fans 0
comment 0
visits 46669
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
linux下安装mysql
盼盼love的博客
Original
868 people have browsed it

Linux下mysql的安装方法有三种1、yum/rpm  2、源码安装  3、二进制安装

第一种安装方式就不说了 这里所说的升级主要是二进制安装的升级方式,十分的简单!

操作平台CentOS 5.5

免费下载地址在 http://linux.linuxidc.com/

用户名与密码都是www.linuxidc.com

一、yum/rpm 方式的安装

首先寻找可以安装的包(镜像站可以提供的,这里采用的是上海交通大学的linux镜像站)

[root@localhost ~]# yum search mysql(通过这个命令可以找出需要安装的几个包,mysql.i386 mysql-bench.i386,mysql-devel.i386,mysql-server.i386 )
[root@localhost ~]# yum -y install mysql.i386 mysql-bench.i386 mysql-devel.i386 mysql-server.i386 (这条命令下去就可以很开心点的安装好了)

二、二进制安装

[root@localhost ~]# tar zxvf mysql-standard-5.0.16-linux-i686.tar.gz  (解压一下)

[root@localhost ~]# mv mysql-standard-5.0.16-linux-i686/ /usr/local/
[root@localhost ~]# cd /usr/local/
[root@localhost local]# ln -s  mysql-standard-5.0.16-linux-i686/ mysql
[root@localhost local]# mkdir /opt/mysql
[root@localhost local]# chown mysql.mysql /opt/mysql/
[root@localhost mysql]# cp -fp support-files/my-medium.cnf.sh my3307.cnf

[root@localhost mysql]# vi my3307.cnf (修改以下的语句)


[client]
#password       = your_password
port            = 3307
socket          = /tmp/mysql3307.sock
[mysqld]
port            = 3307
socket          = /tmp/mysql3307.sock
basedir=/usr/local/mysql
datadir=/opt/mysql
[root@localhost mysql]# ./scripts/mysql_install_db --defaults-file=./my3307.cnf --user=mysql (数据库的初始化)

[root@localhost mysql]# chown -R root.mysql .
[root@localhost bin]# ./mysqld_safe --defaults-file=../my3307.cnf --user=mysql &(启动数据库)

[root@localhost bin]# netstat -tulnp|grep 3307(查看已经启动成功了)
tcp        0      0 0.0.0.0:3307                0.0.0.0:*                   LISTEN      20511/mysqld 

[root@localhost bin]# ./mysql -uroot -S /tmp/mysql3307.sock (数据库的连接)

原文链接:https://www.linuxidc.com/Linux/2011-11/46710.htm

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post