您的位置:首页 > 数据库 > MySQL

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

2014-10-25 23:43 429 查看
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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: