Tagged: phpmyadmin

phpMyAdmin has no type error

Problem: There is an error in phpMyAdmin export page -- “Field:group: xxx has no type”

Solution: update Form.php in phpMyAdmin path.

  1. Add below function in Form.php
    protected function cleanGroupPaths(array $form): array
    {
        foreach($form as &$name) {
            if (mb_strpos((string) $name, ':group:') === 0) {
                $name = str_replace('/', '-', $name);
            }
        }
        return $form;
    }

2. update loadForm function

    public function loadForm($form_name, array $form)
    {
        $this->name = $form_name;

        $form=$this->cleanGroupPaths($form);

        $this->readFormPaths($form);
        $this->readTypes();
    }
}

ref: https://github.com/williamdes/phpmyadmintest/commit/47971806316304f650ca1b3742e2a53801d2a794

phpMyAdmin problem – configuration storage is not completely configured, some extended features have been deactivated.

Problem: Some day enter Phpmyadmin then an message pop up -- “configuration storage is not completely configured, some extended features have been deactivated.”

Solution: You can create a table for storing configuration.

  1. import script from phpMyAdmin/sql/create_tables.sql
  2. create user and grant SELECT, INSERT, DELETE, UPDATE, ALTER privileges in phpMyAdmin.
  3. open config.inc.php and update below line (uncomment it)
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = 'password_you_set_in_phpmyadmin';

/* Storage database and tables */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';

Solve “rediect too many times” in WordPress during migration

Problem: I’m using CentOS + Nginx + MySQL + phpMyAdmin. and all config is correct, which includes all the DB tables (domain updated), wp-config.php. but still encounter too many redirect problem.

Solution: If you sure you set up correctly, you can first delete all your tables, but not your database.

Then open https://yourdomain/wp-admin/install.php. Try to install the tables through WordPress wizard.

After you can enter the newly created default website, then go back to phpMyAdmin. Import the MySQL file again, it is ok to overwrite the original. Finally the problem solved.

Add basic authentication in phpMyAdmin in CentOS 7

Problem: Want to increase phpMyAdmin security, for example adding one more gateway before entering username and password in xxx/phpmyadmin

This is possible and can be achieved in two way:

Solution: first find out where the PHPMyAdmin folder

find /etc/httpd/ -print0 | xargs -0 grep phpmyadmin

then create a .htpasswd ย file for the user you want, like user1.

sudo htpasswd -c /etc/httpd/.htpasswd user1

the output will look like this:

user1:$apr1$0r/2zNGG$jopiWY3DEJd2FvZxTnugJ/

Way 1 -- edit /etc/httpd/conf/httpd.conf , change into below content:

<Directory /usr/share/phpmyadmin>
    AuthType Basic
    AuthName "Restricted Content"
    AuthUserFile /etc/httpd/.htpasswd
    Require valid-user
</Directory>

Way 2 -- go to phpMyAdmin folder that finds out via the previous command, add .htaccess file with below content:

AuthType Basic
AuthName "Admin Login"
AuthUserFile /etc/httpd/pma_pass
Require valid-user

Chinese Character from mysql turned into a question mark in PHP

Problem: already knew the solution below and follow them but still not work:

DB (phpmyadmin) -- change encoding to utf8_general_ci

Backend -- header(“Content-Type:text/html; charset=utf-8”); and mysqli_set_charset( “utf8”,$connect); added.

frontend -- <meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>

Solution: Check again if the codes and methods are all correct. This time the
mysqli_set_charset parameter is not correct -- should be mysqli_set_charset($connect,”utf8″);

Block IP in phpmyadmin

problem: block IP in phpmyadmin (or allow some IP only)

Solution: edit /etc/phpmyadmin/apache.conf file (Ubuntu) to restrict access in PHPMyAdmin. In apache.conf file, find “/usr/share/phpmyadmin” in the file and change to below

<Directory /usr/share/phpmyadmin>
Order allow,deny
Allow from 192.168.1.0/24

save it and restart apache

sudo service apache2 restart