0
I have the following problem, I use Ubunto and installed mariadb, and when I try to access mysql with:
mysql -u root
The following error appears:
ERROR 1698 (28000): Access denied for user 'root'@'localhost'
And then I can access it using:
sudo mysql -u root
And now, when I try to do:
$conexao = mysqli_connect('localhost', 'root', '', 'php_alura');
Nothing happens, and my page doesn’t even render.
Can someone help me?
Updating:
One observing important is that I can only access mysql by Bach using the permission sudo, that is to say with:
sudo mysql -u root
I can get access.
What code are you using to access and display the data? What page code does not render?
– Isac
So buddy, the connection code is as follows::
$conexao = mysqli_connect('localhost', 'root', '', 'php_alura');
However I gave a Restart in apache and is now rendering the pages, but I can not connect to mysql. OBS: I can only move mysql through the panel using the permission of sudo, I believe you have some relationship, but I don’t know how to solve.– Carlos Roberto