0

i tried to replace mysql with MariaDB, removed, installed, removed, installed again mysql and i am stuck now when i try to reinstall mysql

sudo apt-get install mysql-server

with this message:

There is a MySQL server running, but we failed in our attempts to stop it. Stop it yourself and try again!

But there isnt any mysql server running:

ps -ef | grep mysql

xxxxx 13881 13041 0 00:59 pts/6 00:00:00 grep --color=auto mysql

Any idea how i can solve this problem and install mysql again?

piper
  • 1
  • 3

2 Answers2

0

Please take a look at this link. According to this answer

The solution could be removing the following symbolic link:

root@box{~}:la /etc/systemd/system/mysql.service lrwxrwxrwx 1 root root 35 Feb 9 22:55 /etc/systemd/system/mysql.service -> /lib/systemd/system/mariadb.service

If you get the following error: 1524: Plugin 'unix_socket' is not loaded while connecting to the MySQL server

Try the answer from this link

Become root

sudo su

Stop MySQL, bypass authentication, connect as root

/etc/init.d/mysql stop
mysqld_safe --skip-grant-tables &
mysql -uroot

Use the administrative db

use mysql;

Reset the root password

update user set password=PASSWORD("mynewpassword") where User='root';

Reset authentication method

update user set plugin="mysql_native_password";

Exit the mysql console

quit;

Stop and start mysql related processes

/etc/init.d/mysql stop
kill -9 $(pgrep mysql)
/etc/init.d/mysql start

Exit su mode and try connecting to the mysql server

0

Got it now...

sudo apt-get remove --purge mysql*
sudo apt-get remove --purge mariadb*

and remove all mysql databases (you will be asked if you want to remove them), then I can do a fresh install of mysql-server without error messages.

piper
  • 1
  • 3