Sudo mysql_secure_installation give error

Hello Everyone,

I am getting error when i run command below command. error mentioned in attached image
“sudo mysql_secure_installation”

Please guide me about this issue

Thanks

@sheerazkaleem Please run this command or check this documentation link.

sudo apt install mariadb-server mariadb-client

Thanks for reply
I already run your mentioned command and mariadb-server and mariadb-client is installed.

now i need to run this command

sudo mysql_secure_installation

but getting above mentioned error.

@Meet i already following your mentioned document and i stuck on below command.

sudo mysql_secure_installation

Anyone can guide me to resolve this issue?

@Meet Please, you or anyone, please help me in this issue.
i am still stuck in this issue

Hello @sheerazkaleem,

First check if MariaDB is running or not.

sudo systemctl status mariadb

Then, Check If the Path to the Binary Is Set

The mysql_secure_installation command is located in the /usr/bin directory. You can check if the path to the binary is set by running the command echo $PATH . If the path is not set, you can set it by running the command export PATH=$PATH:/usr/bin .

Try to execute sudo mysql_secure_installation again.

@Hardik_Zinzu bro you can see the above images mariadb is running and active
also the path showing in 2nd image but still

mysql_secure_installation

command not working.

Use below command and it will definitely work.

apt-get remove --purge mysql*

sudo apt-get autoremove

sudo apt-get autoclean

sudo apt-get remove dbconfig-mysql

sudo apt-get dist-upgrade

sudo apt-get install mysql-server

sudo apt update

sudo apt install mariadb-server mariadb-client

mariadb-secure-installation