Here is a nice “Copy & Paste” script that you can use for installing MySQL.
This script skips the “mysql_secure_installation” part, in which you need to answer questions, and simply inserts all the needed information directly into the database.
This script was tested under Linux CentOS 7, and is using the Yum repository for installation.
yum install -y --nogpgcheck http://dev.mysql.com/get/mysql57-community-release-el7-7.noarch.rpm sed -i 's/enabled=1/enabled=0/g' /etc/yum.repos.d/mysql-community.repo yum --nogpgcheck install mysql-community-server --enablerepo=mysql56-community -y /etc/init.d/mysqld start GENERATE_MYSQL_ROOT_PASSWORD=`date +%s | sha256sum | base64 | head -c 12 ; echo` DATABASE_PASS="$GENERATE_MYSQL_ROOT_PASSWORD" mysql -u root < /root/.my.cnf
Leave a Reply