After a crash, I re-installed Ubuntu on my dev machine over the previous installation, and after I re-installed all the necessary packages (including mysql-server and mysql-client) I went on restoring the dev database. Unfortunately, I am unable to connect.
This works :
$ sudo su
# mysql -u root
this does not
$ mysql -u root -p
- I have tried purging
mysql-*and reinstalling everything. - I have tried reconfiguring (i.e.
sudo dpkg-reconfigure mysql-server-5.7) - I have tried manually reseting the password using
UPDATEqueries. - I have tried everything here (ecept that the table
userdoes not have apasswordcolumn, but anauthentication_stringone)
Please, can someone help me get this thing working?
** Edit **
mysql> SELECT user, host, authentication_string, password_expired, account_locked FROM user WHERE user = 'root';
+------------------+-----------+-------------------------------------------+------------------+----------------+
| user | host | authentication_string | password_expired | account_locked |
+------------------+-----------+-----------------------+------------------+----------------+
| root | localhost | *<password hash> | N | N |
| root | % | *<password hash> | N | N |
+------------------+-----------+-----------------------+------------------+----------------+
5 rows in set (0.00 sec)
Both root users have the same password, set using PASSWORD('password'), and all privileges have been flushed, then the service was restarted.
Contrary to what the documentation says, running sudo dpkg-reconfigure mysql-server-5.7 does not prompt me to specify a new password for root. The command terminates successfully, but I am never asked to specify a password.