I have followed all the steps of the LAMP installation tutorial in ubuntu 20.04 and even mysql is all enabled with flush privileges I don’t understand why I get this error mysqli_real_connect(): (HY000/1698): Access denied for user ‘root’@’ localhost’
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Alternatively, if you still haven’t run mysql_secure_installation:
You need to change the authentication parameters, to do so just run this command first.
Then run This ALTER Query to change the authentication parameters.
And now, you are able to run mysql_secure_installation command.
Hope that solve your issue,
Hi @DavidLuceroSigcho,
If you’ve used the mysql_secure_installation then you’ll need to use a password when connecting to your root user.
This will ask you for the root MySQL password. Once you give it, you’ll enter.
If you don’t want to use a password for MySQL when you are root, you can create a file in
/root/.my.cnf
and add the following:where RootPasswordHere is your actual password.