Skip to content

Instantly share code, notes, and snippets.

@christopher-baek
Created April 3, 2016 23:13
Show Gist options
  • Save christopher-baek/1337b6675179912e0ccc263f38ad75bc to your computer and use it in GitHub Desktop.
Save christopher-baek/1337b6675179912e0ccc263f38ad75bc to your computer and use it in GitHub Desktop.
Install MySQL Without Root
# Default options are read from the following files in the given order:
# /etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
[mysqld]
user=mysql_owner
datadir=/path/to/datadir/mysql
socket=/path/to/datadir/mysql/mysql.sock
skip-innodb
[mysql.server]
user=mysql_owner
basedir=/path/to/datadir
[client]
user=mysql_owner
socket=/path/to/datadir/mysql/mysql.sock
[safe_mysqld]
err-log=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
# Download from http://dev.mysql.com/downloads/mysql/
# create directory structure
mkdir -p ~/.local/opt/
# extract
tar -xvf mysql-5.7.11-linux-glibc2.5-x86_64.tar.gz -C ~/.local/opt
cd ~/.local/opt/mysql-5.7.11-linux-glibc2.5-x86_64
# initialize
bin/mysqld --initialize
# secure it
bin/mysql_secure_installation
# start it
bin/mysqld_safe
# stop it
bin/mysqladmin shutdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment