Can't start reinstall of mysql on Deepin'; Password issue

password

#1

Hello all,
On the process of a Lamp server install, httpd went fine, but have issues with MariaDb config. I forgot my password and can’t login as root with or without password. Tried many troubleshoots from MySql, Wiki and others. Tried to remove, reinstall and repair nothing does it. I am stucked here:

2]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we’ll need the current
password for the root user. If you’ve just installed MariaDB, and
you haven’t set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
Enter current password for root (enter for none):
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: YES)
Enter current password for root (enter for none):
Thanks for help or direction


#2

Does the mysql installation contain any data?

If not - try uninstalling mariadb - then move/remove the folder /var/lib/mysql.

If you have a mysql user use userdel -r <mysqluser>

Reinstall mariadb


#3

Try https://www.digitalocean.com/community/tutorials/how-to-reset-your-mysql-or-mariadb-root-password


#4

Thank you very much fhdk and pixel27 for your help, I tried to reset the password first, but root was still denied. I then uninstalled mariadb and removed /var/lib/mysql and reinstalled without any problem…


#5

2 posts were split to a new topic: Reinstall mariadb - mysql