S
S
Sergey2019-08-06 00:23:32
MySQL
Sergey, 2019-08-06 00:23:32

Why is MySQL password not set?

Good evening, I'm trying to write a bash script, but I don't understand one thing, why it sets the root password and doesn't log in with the error "#1698 Unable to connect to the MySQL server". Here is the code itself:

apt-get install -y pwgen
MYSQLPASS=$(pwgen -cns -1 12)
log_t "Install MySQL"
echo mysql-apt-config mysql-apt-config/select-server select mysql-5.7 | debconf-set-selections
echo mysql-apt-config mysql-apt-config/select-product select Ok | debconf-set-selections
echo mysql-server mysql-server/root_password select "$MYSQLPASS" | debconf-set-selections
echo mysql-server mysql-server/root_password_again select "$MYSQLPASS" | debconf-set-selections
wget https://dev.mysql.com/get/mysql-apt-config_0.8.9-1_all.deb
export DEBIAN_FRONTEND=noninteractive
dpkg -i mysql-apt-config_0.8.9-1_all.deb
apt-get update
apt-get --yes --force-yes install mysql-community-server
rm mysql-apt-config_0.8.9-1_all.deb
log_t "Install phpMyAdmin"
echo "phpmyadmin phpmyadmin/dbconfig-install boolean true" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/admin-user string root" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/admin-pass password $MYSQLPASS" | debconf-set-selections
echo "phpmyadmin phpmyadmin/mysql/app-pass password $MYSQLPASS" |debconf-set-selections
echo "phpmyadmin phpmyadmin/app-password-confirm password $MYSQLPASS" | debconf-set-selections
echo 'phpmyadmin phpmyadmin/reconfigure-webserver multiselect apache2' | debconf-set-selections
apt-get install -y phpmyadmin

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question