First install apache2, then MariaDB in ubuntu via:
sudo apt-get install apache2
sudo apt-get install mariadb-client mariadb-server mycli
Check that the database server “MySQL” or mariadb is running:
Next install phpmyadmin which will modify the configurations in apache2:
sudo apt-get install phpmyadmin
So after this if mariadb or mysql server is not install, you will get the following:
Otherwise all will end quietly – most likely successful.
Next is point the browser to http://localhost/phpmyadmin:
After login with default user “phpmyadmin”:
This is the point of this entire blog: why is the user phpmyadmin not given any privileges at all?
There is no way to create database at all, because of lack of privileges. And default you cannot even create any users in the database:
You can verify this privileges via:
mysql -u phpmyadmin -p
and basically query all database privileges via command line.
May be phpmyadmin is designed this way, but I need a web-based interface to manage my MariaDB database – mainly to create a new database for my WordPress installation.
So how do you overwrite the old password and create a new user?
There is a “root” user, but only access if you login mysql as root:
The second approach – using “mysql -u root” has to succeed, without running as root, in order for the phpmyadmin application be able to run “mysql -u root”.
To do this, first shutdown MariaDB, and add “skip-grant-tables” to the config file:
sudo service mariadb stop
vi /etc/mysql/mariadb.conf.d/50-server.cnf
and inside the “[mysqld]” section add “skip-grant-tables”:
Then now issue:
mysql -u root
> update mysql.user set password=password(‘newpass’) where user=’root’;
> flush privileges;
> update mysql.user set plugin=’mysql_native_password’ where user=’root’;
> flush privileges;
Reference this: https://stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost)
https://stackoverflow.com/questions/49926467/you-are-using-mariadb-as-an-anonymous-user
And stop the database:
sudo service mariadb stop
Now edit the “mysqld” section inside
vi /etc/mysql/mariadb.conf.d/50-server.cnf
And remove the “skip-grant-tables”, and restart the database:
sudo service mariadb restart
And now the command “mysql” should not allow you to connect in anymore without password, but succeeded upon entering the password you just set:
And now logging in via the phpmyadmin interface using “root” as the user:
Now all the privileges to “root” user is available.
Next is to create a “wordpress” user, and requiring the database to have the same name:
After all these wordpress will be successfully installed:
You must be logged in to post a comment.