Announcement Announcement Module
No announcement yet.
Installing Enterprise MySQL version in CentOS Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Installing Enterprise MySQL version in CentOS

    For installing Enterprise MySQL version in linux, we need to download the required MySQL version from Oracle's site, for this you may need to signup to Oracle's page.

    Once you registered to Oracle, you can download the required version from their site, you will get a zip file named like you need to extract the zip file then you will have 2 to 3 tar.gz files.


    Choose the first tar file and copy it to the server in which you want to install Enterprise MySQL.

    Eg: scp mysql-advanced-5.6.21-linux-glibc2.5-x86_64.tar.gz root@x.x.x.x:/root
    rsync -e ssh -av mysql-advanced-5.6.21-linux-glibc2.5-x86_64.tar.gz --progress root@x.x.x.x:/root

    Then follow the steps:

    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 &
    # Next command is optional
    shell> cp support-files/mysql.server /etc/init.d/mysql.server

    Now the MySQL service should be running in server, you can check the status by the command;

    root@server] /etc/init.d/mysql.server status
    SUCCESS! MySQL running (27383)

    You can check the MySQL version by the command;

    /usr/local/mysql/bin/mysql -V

    Now it is required to setup the short cut for mysql command using 'export'

    First check whether mysql is present in PATH by using the command;

    echo $PATH

    if mysql is not there, you need to add mysql to the PATH

    export PATH=/usr/local/mysql/bin:$PATH >>

    Now its the time to setup MySQL root password, for this you need to stop MySQL and login to MySQL as safe mode.
    /etc/init.d/mysql.server stop
    /usr/local/mysql/bin/mysqld_safe --skip-grant-tables &
    mysql -u root
    mysql> use mysql;

    mysql> update user set password=PASSWORD("NEW-ROOT-PASSWORD") where User='root';
    mysql> flush privileges;
    mysql> quit
    /etc/init.d/mysql.server stop
    /etc/init.d/mysql.server start

    You should now be able to login to MySQL as root with the new password:

    mysql -u root -p'new password'

    That's it.