我正在尝试设置一个流浪盒并让它自动安装Nginx,php,mysql和phpmyadmin作为开发盒。前三个安装和工作没有问题,但phpmyadmin总是返回一个错误,说没有密码的root用户没有访问权限。但据我所知,在debconf设置中设置了所有相关信息。
以下是我的设置脚本的主要部分:
#!/bin/bash
sudo su
export DEBIAN_FRONTEND=noninteractive
#apt-get update -q
# Set root password for mysql
debconf-set-selections <<< 'mysql-server mysql-server/root_password password rootpass'
debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password rootpass'
# Set phpmyadmin paramaters for install
debconf-set-selections <<< 'phpmyadmin/debconfig-install boolean true'
debconf-set-selections <<< 'phpmyadmin/mysql/admin-user string root'
debconf-set-selections <<< 'phpmyadmin/mysql/admin-pass password rootpass'
debconf-set-selections <<< 'phpmyadmin/mysql/app-pass password rootpass'
debconf-set-selections <<< 'phpmyadmin/app-password-confirm password rootpass'
debconf-set-selections <<< 'phpmyadmin/reconfigure-websever multiselect none'
debconf-set-selections <<< 'phpmyadmin/database-type select mysql'
debconf-set-selections <<< 'phpmyadmin/setup-password password rootpass'
# Install mysql, nginx, php5-fpm
apt-get install -q -y -f mysql-server nginx php5-fpm
# Install commonly used php packages
apt-get install -q -y -f phpmyadmin php5-mysql php5-mcrypt php5-curl
错误消息
==> default: Setting up phpmyadmin (4:4.0.10-1) ...
==> default: dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf
==> default: Creating config file /etc/dbconfig-common/phpmyadmin.conf with new version
==> default: Creating config file /etc/phpmyadmin/config-db.php with new version
==> default: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO).
==> default: unable to connect to mysql server.
==> default: error encountered creating user:
==> default: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
==> default: dbconfig-common: phpmyadmin configure: noninteractive fail.
==> default: dbconfig-common: phpmyadmin configure: ignoring errors from here forwards
==> default: populating database via sql...
==> default: done.
==> default: dbconfig-common: flushing administrative password
设置设置可能比需要的多,但我一直在尝试远程看起来与密码相关的所有内容!
答案 0 :(得分:1)
很抱歉,但我希望这有助于将来的某些人:(我错过了一个关键因素,整个上午都让我头疼。
我错过了存在的对象类型:
debconf-set-selections <<< 'phpmyadmin/debconfig-install boolean true'
应阅读:
debconf-set-selections <<< 'phpmyadmin phpmyadmin/debconfig-install boolean true'
注意phpmyadmin的开头! OPPS!