Quick install/config guide:ΒΆ

  1. Install rpms

  2. run mysql_install_db

  3. Lock root user by running one of the following:

    /usr/bin/mysqladmin -u root password 'new-password'
    /usr/bin/mysqladmin -u root -h nap password 'new-password'
    /usr/bin/mysql_secure_installation ## more than just pwd
  4. Check my.cnf files for content:

    • /usr/my.cnf
    • /etc/my.cnf
  5. Update ownership/permissions: chown -R mysql:mysql /var/lib/mysql

  6. Create non-root/admin users

    • Create admin user:

      create user dkoleary identified by '${pwd}';;
      grant all privileges on *.* to 'dkoleary'@'%' with grant option;
      grant all privileges on *.* to 'dkoleary'@'localhost'
      with grant option;
      set password for '${user}'@'%' = password('${pwd}');
      set password for '${user}'@'localhost' = password('${pwd}');
    • Create application user as needed:

      create user 'cmdb'@'localhost' identified by 'nuther_pwd';
      grant select, insert, update, delete, create, drop
      on cmdb.*
      to 'cmdb'@'localhost';
  7. Create and restore db:

    create database cmdb
    mysql -u dkoleary -p cmdb < ${backup_file}
  8. kickstart post scipt: Assumes repo is aleady installed and/or available via spacewalk like environment.

    echo ''
    echo "Removing OEM mysql rpms:"
    echo "------------------------"
    yum -y erase mysql php-mysql
    echo ''
    echo "Enabling mysql community channels:"
    echo "----------------------------------"
    for c in mysql56.x86_64 mysql_connectors.x86_64 mysql_tools.x86_64
        rhn-channel -a -c ${c} -u admin -p Not_really_my_pwd
    echo ''
    echo "Installing mysql community  gpg key:"
    echo "------------------------------------"
    rpm --import http://repo.mysql.com/RPM-GPG-KEY-mysql
    echo ''
    echo "Installing community mysql packages:"
    echo "------------------------------------"
    yum -y install mysql-workbench-community mysql-community-server \
        mysql-community-client php-mysql tinyxml libzip php phpmyadmin \
        mysql-utilities httpd firefox
    echo ''
    echo "Correcting permissions and configs:"
    echo "-----------------------------------"
    chown -R mysql:mysql /var/lib/mysql
    cd /etc/httpd/conf.d
    mkdir -m 700 RCS && echo phpMyAdmin.conf | ci -l phpMyAdmin.conf