# apt update # apt install mariadb-server # mysql_secure_installation
Enter a root password.
# apt update
# apt install phpmyadmin php-mbstring php-gettext # phpenmod mbstring # systemctl restart apache2
Select Yes when asked whether to use dbconfig-common to set up the database.
# mariadb -u root -p MariaDB [(none)]> CREATE USER 'user'@'localhost' IDENTIFIED BY 'password'; MariaDB [(none)]> GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' WITH GRANT OPTION; MariaDB [(none)]> exit
Edit /etc/apache2/conf-available/phpmyadmin.conf:
Alias /phpmyadmin /usr/share/phpmyadmin <Directory /usr/share/phpmyadmin> Options FollowSymLinks DirectoryIndex index.php # Allow user to access without password Include conf-available/user-access.conf <IfModule mod_php5.c> <IfModule mod_mime.c> AddType application/x-httpd-php .php </IfModule> <FilesMatch ".+\.php$"> SetHandler application/x-httpd-php </FilesMatch> php_flag magic_quotes_gpc Off php_flag track_vars On php_flag register_globals Off php_admin_flag allow_url_fopen Off php_value include_path . php_admin_value upload_tmp_dir /var/lib/phpmyadmin/tmp php_admin_value open_basedir /usr/share/phpmyadmin/:/etc/phpmyadmin/:/var/lib/phpmyadmin/:/usr/share/php/php-gettext/:/usr/share/javascript/:/usr/share/php/tcpdf/ </IfModule> </Directory>
conf-available/user-access.conf contains:
# Allow user to access without password Require ip www.xx.yyy.zzz
# * Query Cache Configuration query_cache_limit = 64M query_cache_size = 256M # * InnoDB innodb_buffer_pool_size = 1024M # * Aria aria_pagecache_buffer_size = 256M