MySQL non-root setup

So, I was trying to setup web server for Azkaban in order to automate or streamline job submission, and it requires a MySQL DB for user authentication process (http://azkaban.github.io/azkaban/docs/latest/#database-setup). Again, as an untrusted employee like many others, I do not have sudo access and that’s causing a lot of pain. Between waiting for System Admins for a few working days and finding out about non-root setup myself, I chose the latter and it was rewarding! Now I no longer need others for MySQL setup ever again.

Note: — = – –

Installing

  1. Download the binaries:
    wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
  2. Unpack it:
    tar -zxvf mysql-5.7.19-linux-glibc2.12-x86_64.tar.gz
  3. Create necessary folders:
    mkdir /your/path/to/mysql_files
    mkdir /your/path/to/mysql_data

Initializing

  1. Initialize MySQL DB:
    /your/path/to/mysql-5.7.19-linux-glibc2.12-x86_64/bin/mysqld –initialize –basedir=/your/path/to/mysql-5.7.19-linux-glibc2.12-x86_64 –datadir=/your/path/to/mysql_data –pid-file=/your/path/to/mysql_files/any_name.pid –character-sets-dir=/your/path/to/mysql-5.7.19-linux-glibc2.12-x86_64/share/charsets/ –general-log-file=/your/path/to/mysql_files/any_name.log –lc-messages-dir=/your/path/to/mysql-5.7.19-linux-glibc2.12-x86_64/share/ –plugin-dir=/your/path/to/mysql_files/lib/plugin –slave-load-tmpdir=/your/path/to/mysql_files/tmp

Starting

  1. Start MySQL DB:
    /your/path/to/bin/mysqld –basedir=/your/path/to/mysql-5.7.19-linux-glibc2.12-x86_64 –datadir=/your/path/to/mysql_data–pid-file=/your/path/to/mysql_files/any_name.pid –character-sets-dir=/your/path/to/mysql-5.7.19-linux-glibc2.12-x86_64/share/charsets/ –general-log-file=/your/path/to/mysql_files/any_name.log –lc-messages-dir=/your/path/to/mysql-5.7.19-linux-glibc2.12-x86_64/share/english/ –plugin-dir=/your/path/to/mysql_files/lib/plugin –slave-load-tmpdir=/your/path/to/mysql_files/tmp –socket=/your/path/to/mysql_files/any_name.sock

Accessing

  1. Getting into client:
    /your/path/to/mysql-5.7.19-linux-glibc2.12-x86_64/mysql –socket=/your/path/to/mysql_files/any_name.sock -u root -p
  2. Changing password:
    SET PASSWORD = PASSWORD(‘xxxxxxxx’);

Shutting down

  1. Shutting down:
    /your/path/to/mysql-5.7.19-linux-glibc2.12-x86_64/bin/mysqladmin -u root -p –socket=/your/path/to/mysql_files/any_name.sock shutdown

Ta-Da! You get to interact with Sys. Admin less now = More productivity!

Leave a Reply