Well, I was able to solve this, if someone later passed the same error here is the solution:
1. Uninstall all mysql from my system with the following command:
1. sudo apt-get --purge remove mysql-client mysql-server mysql-common
2. sudo apt-get autoremov
3. sudo rm -rf /etc/mysql/
Well now a little explanation for what we did.
- purge: We removed the packages and the configuration files.
remove: uninstall the packages.
autoremove: Force to eliminate the packages that were installed automatically due to the needs of the dependencies of other packages and now they are no longer needed.
Then I install mysql again but with these commands:
sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation
The necessary steps to follow I found on this page:
install mysql with users and passwords