0

mysqli_connect(): (HY000/1045): Access denied for user ''@'localhost' (using password: NO)

i'm getting this error above on localhost, my connection config:

DB_CONNECTION=mysql
DB_HOST=localhost
DB_NAME=projeto_todobicho
DB_USER=root
DB_PASS=
DB_PORT=3306

I try change the config in config.inc.php, but dosn't worked. In other post i read about create a new user and pass, but the same thing happen.

/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';

/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'root';
$cfg['Servers'][$i]['controlpass'] = '';
ramos
  • 1
  • change the password for `root`, see [MySQL root password change](https://stackoverflow.com/questions/7534056/mysql-root-password-change), or when you do not know the current password use [How to Reset the Root Password](https://dev.mysql.com/doc/refman/8.0/en/resetting-permissions.html) – Luuk Oct 30 '22 at 14:37
  • Does this answer your question? [MySQL root password change](https://stackoverflow.com/questions/7534056/mysql-root-password-change) – Luuk Oct 30 '22 at 14:38
  • Does this answer your question? [MySQL Error: : 'Access denied for user 'root'@'localhost'](https://stackoverflow.com/questions/41645309/mysql-error-access-denied-for-user-rootlocalhost) – Tangentially Perpendicular Oct 30 '22 at 18:53

0 Answers0