简体   繁体   中英

Unable to remove MySQL-server on Ubuntu

I'm trying to reinstall mysql-server on Ubuntu, since I accidentely removed some users and now phpmyadmin doesn't seem to be working giving me #1449 - The user specified as a definer ('mysql.infoschema'@'localhost') does not exist . Because I removed mysql user and now I don't know how to recreate it with the password that only the system knows.

So, I decided to reinstall mysql. However, when I'm trying to remove it with command sudo apt-get remove --purge mysql* or similar it gives me these errors:

E: Unable to locate package mysql-apt-config_0.8.10-1_all.deb
E: Couldn't find any package by glob 'mysql-apt-config_0.8.10-1_all.deb'
E: Couldn't find any package by regex 'mysql-apt-config_0.8.10-1_all.deb'
E: Unable to locate package mysql-apt-config_0.8.9-1_all.deb
E: Couldn't find any package by glob 'mysql-apt-config_0.8.9-1_all.deb'
E: Couldn't find any package by regex 'mysql-apt-config_0.8.9-1_all.deb'
E: Unable to locate package mysqlbinlog

Literally trying to resolve this for hours now with no luck. Can anybody help?

Finally managed to do it with:

sudo -i
service mysql stop
killall -KILL mysql mysqld_safe mysqld
apt-get --yes purge mysql-server mysql-client
apt-get --yes autoremove --purge
apt-get autoclean
deluser --remove-home mysql
delgroup mysql
rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld
updatedb
exit

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM