Problem with mysql-server password

2

I just installed mysql-server in ubuntu and when I wanted to enter it asked for a password, which in the installation did not ask me for any password. I need help with this I have been doing more than 1 day doing things and doing nothing. I thank you all.

  

Versions: 1 Ubuntu 18.04 LTS    2 mysql See 14.14 Distrib 5.7.22, for Linux (x86_64) using EditLine   wrapper

    
asked by Asdrubal Hernandez 09.07.2018 в 02:33
source

2 answers

3

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

    
answered by 09.07.2018 / 03:43
source
3

I have followed the procedure as such and I have been able to reset the administrator's password.

1st You create the sql file with the command to change the password ALTER USER 'root' @ 'localhost' IDENTIFIED BY 'MyNewPass';

2nd Paras mysql kill cat /mysql-data-directory/host_name.pid

3rd Start mysql with the sql file that you created at startup. mysqld --init-file = / home / me / mysql-init &

Although it really worked out to boot the mysql with the --skip-grant-tables parameter At that time, it no longer asks for the password when entering, you change the password to the root, you stop it and start without the parameter.

link

    
answered by 16.07.2018 в 15:01