Solved

Configuration database SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

  • 23 November 2023
  • 5 replies
  • 320 views

Badge +2

Hello,

 

I am installing Centreon 23.10 on Debian 11 by the documentation, using the apt sources.

Web And Post Installation | Centreon Documentation

everything is done as “root” (su -)

 

I found this topic related to my case:Install Error: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' | Community (centreon.com)

same issue for me; stuck at step 7 :

 

  • i ran mysql_secure_installation and replied “yes” to all question except “disallow remote login” for which i answered “no” (as mentioned in documentation)
  • ps aux | grep mariadb shows me service is running:

root@centreon-server:~# ps aux | grep mariadb
mysql      35339  0.0  1.4 1871152 118340 ?      Ssl  01:53   0:00 /usr/sbin/mariadbd
root       35505  0.0  0.0   8808   704 pts/0    S+   02:00   0:00 grep mariadb

  • in mysql, SELECT * FROM mysql.user; 

among users i found the root part:

  | localhost | root        | *2B556678EB31Dxxxxxxxxx3775FA3D03E | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      | Y                   |          |            |             |              |             0 |           0 |               0 |                    0 | 

(i hid some of the password hash with xxx)

which seems to implies i have set up a password for the mysql root password?

 

i tried adding localhost also in the form.

 

what did i miss?

 

icon

Best answer by cybervi 23 November 2023, 09:53

View original

5 replies

Userlevel 1
Badge +1

Hi, when you run mysql_secure_installation, have you change the password for root ?

if you just press enter, the user root of mysql dont have a password so it cant work.

Just try to log on mysql with mysql -u root -p with a non-super debian user, if your password work for your mysql root user it will work for step 6-7

Badge +2

hello cybervi,

 

thank you for your quick answer.

Yes, i set up a password in script.

as non root user, mysql -u root -p asked for password. It connects with the password i set in the mysql_secure_installation script (and does not log if i misstype)

one thought: is there special characters in the password that might mess with the code?

i will try again with no special characters, or just a - if a special character is required.

 

i will let you know,

my best

Badge +2

no special characters in root password made the trick.

thank you again for your help,

sincerely

bertrand

Userlevel 1
Badge +1

I dont understand, you solved your problem ?

Badge +2

Yes: installation worked for me when i change mysql root account's password to something without special character 

Reply