sudo apt update
Config file /etc/apache2/apache2.conf
sudo apt install apache2
http://your_server_ip
sudo apt install mysql-server
sudo mysql
Getting all users
mysql> SELECT user,authentication_string,plugin,host FROM mysql.user;
Change user password
Use caching_sha2_password
OR mysql_native_password
depend on version
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';
mysql -u root -p
Create new user
mysql> CREATE USER 'sammy'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';
Grant All privileges
mysql> GRANT ALL PRIVILEGES ON *.* TO 'sammy'@'localhost' WITH GRANT OPTION;
If still you are not able to login then flush changes and restart apache2 server
mysql> FLUSH PRIVILEGES;
Still not restart computer
sudo apt install php libapache2-mod-php php-mysql
sudo apt install php-cli php-fpm php-common php-mbstring php-curl php-gd php-mysqlnd php-json php-xml php-intl php-opcache
sudo systemctl restart apache2
Config file /etc/phpmyadmin/config.inc.php
sudo apt install phpmyadmin php-mbstring php-zip php-gd php-json php-curl
For the server selection, choose apache2
sudo phpenmod mbstring
$cfg['Servers'][$i]['AllowNoPassword'] = TRUE;
sudo vim /etc/apache2/apache2.conf
Add this line at the end of the file
Include /etc/phpmyadmin/apache.conf
mysqli_real_connect(): (HY000/1045): Access denied for user 'phpmyadmin'@'localhost' (using password: NO)
/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';
If phpMyAdmin is not login with default user then create the new one
If apache2
server is downloading file instead of running then remove this from .htaccess
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
<IfModule mime_module>
AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
Like So
# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php72” package as the default “PHP” programming language.
#<IfModule mime_module>
# AddHandler application/x-httpd-ea-php72 .php .php7 .phtml
#</IfModule>
# php -- END cPanel-generated handler, do not edit
AllowOverride All
Replace None with All
sudo vim /etc/apache2/apache2.conf
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
sudo a2enmod rewrite
.htaccess
file config
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
sudo chown -R $USER /var/www
sudo usermod -a -G www-data $USER
sudo chown -R www-data:www-data /var/www
sudo chown -R $USER /var/www/html/
ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
If that doesn't work, try it without @'localhost'
part.