Sorry for my English.
I programmed my first application in PHP+MySQL. It was working fine.
Since a few days I have error connecting to database: Message: mysqli::real_connect(): (HY000/1698): Access denied for user 'root'@'localhost'.
I tried: "mysql -u root -p -h localhost" and I have "Access denied for
user root@localhost'.
Command "sudo mysql -u root -p -h localhost" works fine.
In mysql log I have only access denied.
Reinstalling mysql doesn't help. mysql_upgrade doesn't help, either.
$ mysql --version
mysql Ver 14.14 Distrib 5.7.17, for Linux (i686) using EditLine wrapper
Here you have my privileges:
mysql> show grants for 'root'@'localhost'; +---------------------------------------------------------------------+
| Grants for root@localhost | +---------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION | +---------------------------------------------------------------------+
2 rows in set (0,00 sec)
Please help. I would like to avoid reinstalling Ubuntu.
$ uname -a
Linux pecet 4.4.0-38-generic #57-Ubuntu SMP Tue Sep 6 15:41:41 UTC 2016
i686 i686 i686 GNU/Linux
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 295 |
Nodes: | 16 (2 / 14) |
Uptime: | 18:35:53 |
Calls: | 6,640 |
Files: | 12,187 |
Messages: | 5,325,146 |