phpmyadmin error during installation “Empty value for 'port' specified.”

前端 未结 8 2200
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-31 04:36

I have been trying to install phpmyadmin on my digitalocean droplet using ubuntu 14.04 / mysql 5.7.12 . I have a LAMP stack with apache as the web server.

During instal

相关标签:
8条回答
  • 2021-01-31 05:02

    I've searched the internet for hours but none worked for me except this.

    After changing dbc_dbport='' to dbc_dbport='0' I still encountered some other problems.

    If you are not able to continue the configuration process properly, follow these additional steps:

    First, simply choose Abort.

    Then login to mysql as root using the password you’ve defined when you installed MariaDB.

    mysql -u root -p
    

    Next, issue following command:

    CREATE DATABASE phpmyadmin;
    

    Then, issue following command: (Do not forget to replace changethispassword with your own password of choice.)

    GRANT ALL ON phpmyadmin.* TO phpmyadmin@localhost IDENTIFIED BY 'changethispassword';
    

    Exit mysql> using:

    \q
    

    Next, edit the database configuration:

    sudo gedit /etc/phpmyadmin/config-db.php
    

    Edit the dbpass parameter with the password you’ve just defined.

    <?php
    ##
    ## database access settings in php format
    ## automatically generated from /etc/dbconfig-common/phpmyadmin.conf
    ## by /usr/sbin/dbconfig-generate-include
    ##
    ## by default this file is managed via ucf, so you shouldn't have to
    ## worry about manual changes being silently discarded.  *however*,
    ## you'll probably also want to edit the configuration file mentioned
    ## above too.
    ##
    $dbuser='phpmyadmin';
    $dbpass='changethispassword';
    $basepath='';
    $dbname='phpmyadmin';
    $dbserver='localhost';
    $dbport='';
    $dbtype='mysql';
    

    Replace changethispassword with your own and save. (It must've been already set correctly.)

    0 讨论(0)
  • MySQL behavior has changed here, so you have few options:

    • Use older MySQL version prior this change
    • Use Ubuntu packages which did revert this change (see https://bugs.launchpad.net/ubuntu/+source/dbconfig-common/+bug/1563274)
    • Wait for fixing dbconfig-common, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824537

    Update: You can workaround this bug as described in answer from William Ardila.

    0 讨论(0)
  • 2021-01-31 05:12

    My machine configuration - Ubuntu 16.04 - MySql 5.7.13 - PHP 7.0.8 - Apache 2.4.18

    Edit the file /etc/dbconfig-common/phpmyadmin.conf, changing

    dbc_dbport='' to dbc_dbport='0'

    After editing the file and saving it, if you are still on the dbconfig-common wizard select retry; if not run sudo dpkg-reconfigure phpmyadmin (choose Yes when asked you if you want to Reinstall database for phpmyadmin) and continue normally without changing any value. If you want to change some value do it in the file that you have edited before.

    When configuration window asks what you want to do with existing configuration file choose Keep the local version currently installed.

    At this point you can check the differences and only those must exist that you made in the file.

    0 讨论(0)
  • 2021-01-31 05:12

    Another workaround, I was updating Ubuntu 14.04 -> 16.04:

    • In the wizard select "tcp/ip" as connection method, localhost port 0
    • Read the phpmyadmin user password from /etc/phpmyadmin/config-db.php
    • Change the phpmyadmin user password in the db to it
    • Paste it into the wizard (twice)

    Wizard will run through :)

    0 讨论(0)
  • 2021-01-31 05:13

    Our server config - Debian 8.x Mysql 5.7 PHP 5+7 Apache 2.4

    This should work :

    • unistall phpmyadmin (--purge)
    • reinstall phpmyadmin (ignore errors)
    • check for existence of phpmyadmin user and/or database in mysql using mysql console or whatever means.
    • If they don't exist, manually create them and GRANT phpmyadmin user all privileges on phpmyadmin table.

    • manually edit /etc/dbconfig-common/phpmyadmin.conf so as it reflects your current mysql server setup

    dbc_dbserver = 'your_server'
    dbc_dbport = 'your_mysql_port'
    and any dbc_ fields that you feel need completion at this time
    
    • manually edit /etc/phpmyadmin/config-db.php so as it reflects your current mysql server setup
    $dbserver = same_as_above
    $dbport = your_mysql_listening_port
    etc. - any other fields that you feel needs completing.
    
    • run dpkg-reconfigure phpmyadmin from console with root or administrative privileges

    • choose Reinstall database for phpmyadmin - YES !!

    • when configuration window asks what you want to do with existing configuration file, choose - "Keep the local version currently installed".

    • In the console output you shouldn't have any mysql empty port errors anymore.

    That worked for me.

    0 讨论(0)
  • 2021-01-31 05:17

    None of the above helped in my case - because, somehow, mysql was not running / was not installed (check by sudo systemctl status mysql).

    1. Skip the error in Phpmyadmin installation.
    2. Reinstall mysql by sudo apt-get install mysql-server mysql-client.
    3. Reconfigure with sudo dpkg-reconfigure phpmyadmin and accept the defaults - they will be a bit different this time (but you may want to set the passwords).
    4. Say yes to overwrite the config file with maintainer's version.

    By the way, the port in phpmyadmin.conf remained dbc_dbport=''.

    0 讨论(0)
提交回复
热议问题