Centos安装mysql5.6.10

31 篇文章 0 订阅
29 篇文章 0 订阅

1.先使用 yum -y update 指令升级系统到最新版本

2修改防火墙设置,打开3306端口

参考修改防火墙方法,http://blog.csdn.net/lgq421033770/article/details/8766769

3.新增用户组

 
 groupadd mysql
 
4# 新增用户
 
 useradd mysql -g mysql
5.创建安装目录:

mkdir -p /usr/local/mysql

6.修改目录拥有者

 
  chown -R mysql:mysql /usr/local/mysql
7.编辑PATH搜索路径

vi /etc/profile

 文件最后添加下面两行:
 
  PATH=/usr/local/mysql/bin:/usr/local/mysql/lib:$PATH
 
  export PATH
 
8.# 生效PATH搜索路径
 
  source /etc/profile
 
9.# 编辑hosts文件,加入本机IP和主机名
 
  192.168.211.100 centhost.centdomain
 10.# 安装编译 源码所需的工具和库
 
  yum -y install wget gcc-c++ ncurses-devel cmake make perl
 
11  # 进入源码压缩包下载目录
 
  cd /usr/src
 
12  # 下载源码压缩包
 
  wget http://dev. mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.10.tar.gz/from/http://cdn.mysql.com/
 
13  # 解压缩源码包
 
  tar -zxv -f mysql-5.6.10.tar.gz
 
14 # 进入解压缩源码目录
 
  cd mysql-5.6.10
 
15  # 从mysql5.5起,mysql源码安装开始使用cmake了,下面是cmake安装方法。

[root@server182 mysql-5.6.10]# cmake .
 
[root@server182 mysql-5.6.10]# make && make install
 
-------------------------默认情况下是安装在/usr/local/mysql
 
[root@server182 ~]# chown -R mysql.mysql /usr/local/mysql
 
[root@server182 ~]# cd /usr/local/mysql/scripts
 
[root@server182 ~]# ./mysql_install_db --user=mysql --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data
 
[root@server182 ~]# cd /usr/local/mysql/support-files
 
[root@server182 support-files]# cp mysql.server /etc/rc.d/init.d/mysql
 
[root@server182 support-files]# cp my-default.cnf /etc/my.cnf
 
[root@server182 ~]# chkconfig --add mysql
 
[root@server182 ~]# chkconfig mysql on
 
[root@server182 ~]# service mysql start
 
Starting MySQL SUCCESS! 
 


[root@server182 support-files]# mysql
 
Welcome to the MySQL monitor.  Commands end with ; or \g.
 
Your MySQL connection id is 1
 
Server version: 5.6.10 Source distribution
 
 
 
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
 
 
 
Oracle is a registered trademark of Oracle Corporation and/or its
 
affiliates. Other names may be trademarks of their respective
 
owners.
 
 
 
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
 
 
 
mysql> 
 


mysql> status;
 
--------------
 
mysql  Ver 14.14 Distrib 5.6.10, for Linux (i686) using  EditLine wrapper
 
 
 
Connection id:  1
 
Current database: 
 
Current user:  root@localhost
 
SSL:    Not in use
 
Current pager:  stdout
 
Using outfile:  ''
 
Using delimiter:  ;
 
Server version:  5.6.10 Source distribution
 
Protocol version:  10
 
Connection:  Localhost via UNIX socket
 
Server characterset:  utf8
 
Db    characterset:  utf8
 
Client characterset:  utf8
 
Conn.  characterset:  utf8
 
UNIX socket:  /tmp/mysql.sock
 
Uptime:    5 min 45 sec
 
 
 
Threads: 1  Questions: 5  Slow queries: 0  Opens: 70  Flush tables: 1  Open tables: 63  Queries per second avg: 0.014
 
--------------
 
mysql> 
 
安装完毕。




  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值