Ubuntu 16.04 安裝 Phpmyadmin 出現的問題及解決


ubuntu 16.04 install phpmyadmin

  • $ apt install phpmyadmin
  • 安裝時出現一個錯誤:
    An error occurred while installing the database:
  │
  │ mysql said: mysql: [Warning] mysql: Empty value for 'port' specified.
  │ Will throw an error in future versions ERROR 1819 (HY000) at line 1:
  │ Your password does not satisfy the current policy requirements . Your
  │ options are:
  │  * abort - Causes the operation to fail; you will need to downgrade,
  │    reinstall, reconfigure this package, or otherwise manually intervene
  │    to continue using it. This will usually also impact your ability to
  │    install other packages until the installation failure is resolved.
  │  * retry - Prompts once more with all the configuration questions
  │    (including ones you may have missed due to the debconf priority
  │    setting) and makes another attempt at performing the operation.
  │  * retry (skip questions) - Immediately attempts the operation again,
  │    skipping all questions. This is normally useful only if you have
  │    solved the underlying problem since the time the error occurred.
  │  * ignore - Continues the operation ignoring dbconfig-common errors.
  │    This will usually leave this package without a functional database.
  • 詳細信息日志:
    Preconfiguring packages ...
    Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
    Selecting previously unselected package phpmyadmin.
    (Reading database ... 229335 files and directories currently installed.)
    Preparing to unpack .../phpmyadmin_4%3a4.5.4.1-2ubuntu2_all.deb ...
    Unpacking phpmyadmin (4:4.5.4.1-2ubuntu2) ...
    Processing triggers for doc-base (0.10.7) ...
    Processing 1 added doc-base file...
    Processing triggers for hicolor-icon-theme (0.15-0ubuntu1) ...
    Processing triggers for man-db (2.7.5-1) ...
    Setting up phpmyadmin (4:4.5.4.1-2ubuntu2) ...
    Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
    dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf

    Creating config file /etc/dbconfig-common/phpmyadmin.conf with new version

    Creating config file /etc/phpmyadmin/config-db.php with new version
    granting access to database phpmyadmin for phpmyadmin@localhost: failed.
    error encountered creating user:
    mysql said: mysql: [Warning] mysql: Empty value for 'port' specified. Will throw an error in future versions ERROR 1819 (HY000) at line 1: Your password does not satisfy the current policy requirements
    dbconfig-common: phpmyadmin configure: aborted.
    dbconfig-common: flushing administrative password
    Automatic configuration using dbconfig-common failed!
  • 端口問題通過這篇文章解決了,原因是mysql5.7更改了某些行為,導致phpmyadmin的端口配置失效了。

  • 繼續執行,特么又冒出了新的問題:

    An error occurred while installing the database:                           │
    │                                                                            │
    │ mysql said: ERROR 1819 (HY000) at line 1: Your password does not satisfy   │
    │ the current policy requirements . Your options are:                        │
    │  * abort - Causes the operation to fail; you will need to downgrade,       │
    │    reinstall, reconfigure this package, or otherwise manually intervene    │
    │    to continue using it. This will usually also impact your ability to     │
    │    install other packages until the installation failure is resolved.      │
    │  * retry - Prompts once more with all the configuration questions          │
    │    (including ones you may have missed due to the debconf priority         │
    │    setting) and makes another attempt at performing the operation.         │
    │  * retry (skip questions) - Immediately attempts the operation again,      │
    │    skipping all questions. This is normally useful only if you have        │
    │    solved the underlying problem since the time the error occurred.        │
    │  * ignore - Continues the operation ignoring dbconfig-common errors.       │
    │    This will usually leave this package without a functional database.
    
  • 搜索到這篇文章,我看到了這個:

    Assuming that the validate_password plugin is installed, it implements three levels of password checking: LOW, MEDIUM, and STRONG. The default is MEDIUM; to change this, modify the value of validate_password_policy. The policies implement increasingly strict password tests. The following descriptions refer to default parameter values, which can be modified by changing the appropriate system variables.

    LOW policy tests password length only. Passwords must be at least 8 characters long.

    MEDIUM policy adds the conditions that passwords must contain at least 1 numeric character, 1 lowercase character, 1 uppercase character, and 1 special (nonalphanumeric) character.

    STRONG policy adds the condition that password substrings of length 4 or longer must not match words in the dictionary file, if one has been specified.

  • 看着挺眼熟的,哦,想起來了,我在安裝mysql的時候運行過mysql_installation_security命令,當時,我還選了LOW選項。也就是說密碼必須至少8個字符。

  • 果然重新配置之后,輸入了8個字符的密碼,就成功了。

  • 成功后的日志記錄:
    dbconfig-common: phpmyadmin reconfigure: trying again.
    Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
    dbconfig-common: writing config to /etc/dbconfig-common/phpmyadmin.conf
    Replacing config file /etc/dbconfig-common/phpmyadmin.conf with new version
    Replacing config file /etc/phpmyadmin/config-db.php with new version
    granting access to database phpmyadmin for phpmyadmin@localhost: success.
    verifying access for phpmyadmin@localhost: success.
    dbconfig-common: dumping mysql database phpmyadmin to /var/tmp/phpmyadmin.phpmyadmin.2017-08-13-14.19.mysql.IwpX34.
    database does not exist.
    dbconfig-common: dropping old mysql database phpmyadmin.
    dropping database phpmyadmin: database does not exist.
    creating database phpmyadmin: success.
    verifying database phpmyadmin exists: success.
    populating database via sql... done.
    dbconfig-common: flushing administrative password

phpmyadmin的配置文件和項目文件在哪里?

  • /etc/phpmyadmin/apache.conf
  • /etc/phpmyadmin/config.inc.php
  • 突然想到項目目錄可以到項目conf文件中去找啊!然后找到了
  • /usr/share/phpmyadmin


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM