Monday, June 19, 2017

How to connect to Mariadb with Phpmyadmin

A new debian 9 comes with Mariadb as a substitute of mysql by default. If you don't have the installation of refer to https://mariadb.com/downloads.

Next, you have to install phpmyadmin. Since I am on debian, my command is:

sudo apt-get install phpmyadmin

After that, include the following line in /etc/apache2/apache2.conf.

/etc/phpmyadmin/apache.conf 

After that basically your phpmyadmin will run on http://localhost/phpmyadmin.

Default user name in Mariadb is root without password. So basically you should be able to login Mariadb from cli using user name root.

mysql -u root 

After entering MariaDb, you can set password for user using the following command.

set password for root@localhost = password('newpassword');

So that when you enter now, it will ask you to enter password

mysql -u root  -p

But still you are not able to connect Mariadb from phpmyadmin client. To be able to do that, we need to change some settings.

Enter Mariadb selecting mysql database:

mysql -u root  -p mysql 

Run the following commands:
 
update user set plugin='' where user='root';  
flush privileges;
exit

Now you should be able to connect to Mariadb from phpmyadmin.

Source: https://www.server-world.info/en/note?os=Ubuntu_16.04&p=mariadb&f=2

No comments:

Post a Comment