phpMyAdmin | Cheatsheet¶
phpMyAdmin is a free software tool written in PHP, intended to handle the administration of MySQL over the Web.
phpMyAdmin supports a wide range of operations on MySQL and MariaDB. Frequently used operations (managing databases, tables, columns, relations, indexes, users, permissions, etc) can be performed via the user interface, while you still have the ability to directly execute any SQL statement.
Installation¶
cd /var/www/localhost/htdocs
wget https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.zip
unzip phpMyAdmin-5.2.1-all-languages.zip
mv phpMyAdmin-5.2.1-all-languages phpMyAdmin
rm phpMyAdmin-5.2.1-all-languages.zip
mkdir /var/www/localhost/htdocs/phpMyAdmin/tmp/
chown -R apache:apache /var/www/localhost/htdocs/phpMyAdmin/
Configuration¶
mysql -u<user> -p<password>
create database phpmyadmin;
use phpmyadmin;
grant all privileges on *.* TO '<user>'@'%';
flush privileges;
quit;
Generate a string of random bytes¶
php -r 'echo bin2hex(random_bytes(32)) . PHP_EOL;'
vim /var/www/localhost/htdocs/phpMyAdmin/config.sample.inc.php
Now add the hash to default config: $cfg['blowfish_secret'] = '<add_hash>'