mysql5.7二进制包安装
2019獨角獸企業重金招聘Python工程師標準>>>
mysql5.7二進制包安裝
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 ##如沒有data目錄,自建
shell> mkdir mysql-files
shell> chmod 770 mysql-files
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> bin/mysql_install_db --user=mysql #Before MySQL 5.7.6
shell> bin/mysqld --initialize --user=mysql #MySQL 5.7.6 and up
shell> bin/mysql_ssl_rsa_setup #MySQL 5.7.6 and up
shell> chown -R root .
shell> chown -R mysql data mysql-files
shell> bin/mysqld_safe --user=mysql &
或者 指定配置文件啟動
./bin/mysqld --defaults-file=/usr/local/mysql-5.7.11/support-files/my.cnf --basedir=/usr/local/mysql-5.7.11 --datadir=/usr/local/mysql-5.7.11/data --user=root
?
my.cnf ?內容文件如下:
*************************************************************************
basedir = /usr/local/mysql-5.7.11
datadir = /usr/local/mysql-5.7.11/data
port = 3306
server_id = 1
socket = /tmp/mysql.sock
**************************************************************************
?
update mysql.user set authentication_string=password('root') where user='root' ;
FLUSH PRIVILEGES;
?
隨系統開機啟動、關閉
1、先創建 mysql-startup.sh 腳本文件, 內容如下
!/bin/bash
DEPLOY_DIR=`pwd`
/usr/local/mysql-5.7.11/bin/mysqld --defaults-file=/usr/local/mysql-5.7.11/support-files/my.cnf --user=root
echo $DEPLOY_DIR
?
2、設置mysql-startup.sh ?腳本文件,開機啟動即可?
? ? ? 具體方法 ? 參照?http://my.oschina.net/u/2605948/blog/666975
?
?
?
?
?
轉載于:https://my.oschina.net/u/2605948/blog/643737
總結
以上是生活随笔為你收集整理的mysql5.7二进制包安装的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: php 基础函数写法,字符串,常用函数
- 下一篇: linux cmake编译源码,linu