ubuntu 安装mysql5.6, 二进制包解压安装

shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data

shell> bin/mysqld_safe --user=mysql &

shell> ./bin/mysqladmin -u root password 'new-password'

shell> ./bin/mysqladmin -uroot -ppassw0rd shutdown


# Next command is optional--
shell> cp support-files/mysql.server /etc/init.d/mysql.server


  ./bin/mysqladmin -u root password 'new-password'
  ./bin/mysqladmin -u root -h benny-Aspire-V5-471G password 'new-password'



bin/mysqld_safe --user=mysql 是在安全模式启动mysql,主要是用于配置root的密码。

/bin/mysqladmin -u root password 'new-password' 配置root用户的密码,前提是必须安全模式启动了mysql服务。

/bin/mysqladmin -uroot -ppassw0rd shutdown 关闭安全启动模式的服务

启动mysql服务,sudo /etc/init.d/mysql.server start

关闭mysql服务,sudo /etc/init.d/mysql.server stop








  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值