Configure phpmyadmin in Kali Lin
2018-05-23 本文已影响0人
strivexj
Install phpmyadmin
sudo apt install phpmyadmin php-mbstring php-mysql
cd /usr/share/phpmyadmin
cp config.sample.inc.php config.inc.php
cd /var/www/html
sudo ln -s /usr/share/phpmyadmin
Configure mysql
- There are 2 ways to solve this:
1.You can set the root user to use the mysql_native_password plugin
$ sudo mysql -u root # I had to use "sudo" since is new installation
mysql> USE mysql;
mysql> UPDATE user SET plugin='mysql_native_password' WHERE User='root';
mysql> FLUSH PRIVILEGES;
mysql> exit;
2.You can create a new db_user with you system_user (recommended)
$ sudo mysql -u root # I had to use "sudo" since is new installation
mysql> USE mysql;
//If you want to access from outer network using % instead of localhost
mysql> CREATE USER 'YOUR_SYSTEM_USER'@'localhost' IDENTIFIED BY 'Password';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'YOUR_SYSTEM_USER'@'localhost';
mysql> UPDATE user SET plugin='auth_socket' WHERE User='YOUR_SYSTEM_USER';
mysql> FLUSH PRIVILEGES;
mysql> exit;
Restart apache2 and mysql
/etc/init.d/apache2 restart
/etc/init.d/mysql restart