Created
July 28, 2018 22:21
-
-
Save LukaSikic/61acc0251e7211ca907241bdc3d384c1 to your computer and use it in GitHub Desktop.
Automated mysql_secure_installation ubuntu 18.04
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SECURE_MYSQL=$(expect -c " | |
set timeout 10 | |
spawn mysql_secure_installation | |
expect \"Press y|Y for Yes, any other key for No:\" | |
send \"n\r\" | |
expect \"New password:\" | |
send \"123456\r\" | |
expect \"Re-enter new password:\" | |
send \"123456\r\" | |
expect \"Remove anonymous users? (Press y|Y for Yes, any other key for No) :\" | |
send \"y\r\" | |
expect \"Disallow root login remotely? (Press y|Y for Yes, any other key for No) :\" | |
send \"y\r\" | |
expect \"Remove test database and access to it? (Press y|Y for Yes, any other key for No) :\" | |
send \"y\r\" | |
expect \"Reload privilege tables now? (Press y|Y for Yes, any other key for No) :\" | |
send \"y\r\" | |
expect eof | |
") | |
echo "$SECURE_MYSQL" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment