Solved

Install Error: SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

  • 5 January 2022
  • 10 replies
  • 7365 views

Badge +2

Hi,

 

In first time my appologize for my bad english.

I try to install a clean version of Centreon 21.10 in a physical machine.

I follow this tutorial: Using Centreon ISO · Centreon documentation but without yum update because se computer don’t have internet acces for the moment.

After a reboot, I continue to web installation but when I come to the page “DataBase Information” I have this error: 
SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost'

Password Is ok, I have try to dowload and install again but result is same.

Can you help me for that?


Thanks in advance.
Regards,
Jérome

icon

Best answer by sims24 6 January 2022, 16:09

View original

10 replies

Badge +2

Hi again :)

 

 

I have tester this:

  • Use password without special char => not found
  • Test with by-pass sql secure => not found
  • Installation in old version (19) => Functionnal

Would there be a change of procedure in the installation between the 2 versions or would I miss a step?

 

Thanks in advance for help.

Regards,

Jérome

Userlevel 6
Badge +19

Hi, 

 

To help you efficiently, could you share some information: 

  • What type of setup did you pick during the ISO installation? 
  • Is the mariadb process running ‘ps aux | grep mariadb’? 
  • Please run this query and share the result
    SELECT * FROM mysql.user WHERE User=’root’ 

     

Badge +2

Hi sims24,

Yes of course,

  • What type of setup did you pick during the ISO installation? 
    • Central wit Database
    •  

  • Is the mariadb process running ‘ps aux | grep mariadb’? 
    •  

  • Please run this query and share the result
    • I don’t know where can I execute this commande 
but if can I help you this is the mariadb status:
  • I have the impression that the DB is not created during the installation

Thanks in advance vor your help,

Regards,

Userlevel 6
Badge +19

Hi @Jérome Lalieu 

 

Add a semicolon at the end of the query, you’re running it exactly where you should. 

 

SELECT * FROM mysql.user WHERE User=’root’;

 

Database will not exist until we solve this access denied problem.

 

Simon

Badge +2

Hi @sims24 ,

 

Below the result of the command:

MariaDB [(none)]> SELECT * FROM mysql.user WHERE user='root';
+-----------+------+----------+-------------+-------------+-------------+-------        ------+-------------+-----------+-------------+---------------+--------------+--        ---------+------------+-----------------+------------+------------+-------------        -+------------+-----------------------+------------------+--------------+-------        ----------+------------------+------------------+----------------+--------------        -------+--------------------+------------------+------------+--------------+----        --------------------+---------------------+----------+------------+-------------        +--------------+---------------+-------------+-----------------+----------------        ------+-----------------------+-----------------------+------------------+------        ---+--------------+--------------------+
| Host      | User | Password | Select_priv | Insert_priv | Update_priv | Delete        _priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | F        ile_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv         | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_s        lave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routin        e_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Cre        ate_tablespace_priv | Delete_history_priv | ssl_type | ssl_cipher | x509_issuer         | x509_subject | max_questions | max_updates | max_connections | max_user_connec        tions | plugin                | authentication_string | password_expired | is_ro        le | default_role | max_statement_time |
+-----------+------+----------+-------------+-------------+-------------+-------        ------+-------------+-----------+-------------+---------------+--------------+--        ---------+------------+-----------------+------------+------------+-------------        -+------------+-----------------------+------------------+--------------+-------        ----------+------------------+------------------+----------------+--------------        -------+--------------------+------------------+------------+--------------+----        --------------------+---------------------+----------+------------+-------------        +--------------+---------------+-------------+-----------------+----------------        ------+-----------------------+-----------------------+------------------+------        ---+--------------+--------------------+
| localhost | root | invalid  | 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 | mysql_native_password | invalid               | N                | N               |              |           0.000000 |
+-----------+------+----------+-------------+-------------+-------------+-------        ------+-------------+-----------+-------------+---------------+--------------+--        ---------+------------+-----------------+------------+------------+-------------        -+------------+-----------------------+------------------+--------------+-------        ----------+------------------+------------------+----------------+--------------        -------+--------------------+------------------+------------+--------------+----        --------------------+---------------------+----------+------------+-------------        +--------------+---------------+-------------+-----------------+----------------        ------+-----------------------+-----------------------+------------------+------        ---+--------------+--------------------+
1 row in set (0.001 sec)
 

Regards,

Userlevel 6
Badge +19

The root password isn’t set. That’s probably the problem because you cannot use root without password since MariaDB 10.5 (see https://docs.centreon.com/21.10/en/installation/installation-of-a-central-server/using-centreon-iso.html#secure-the-database


Please run

mysql_secure_installation

 

Then, go back to this screen to set the password:

Please manually type localhost in the “Database Host Address’ field. 

 

Let me know if it’s better now. 

Badge +2

Hi Simon,

 

It’s ok with this solution.

It’s a new security au Centreon or MariaDB? In version 19.x of centreon it was not necessary to perform this operation

 

Anyway, thanks again for your help.

Regards,

Jérome

Userlevel 6
Badge +19

Yes it’s new and specific to MariaDB 10.5. It’s a good move, securing databases is crucial. 

 

Happy to hear that it works now.

 

Enjoy your modern platform :)

 

Badge +2

Just one last question.

Is the 'home' partition useful, or can all available space go to "/"

 

Userlevel 6
Badge +19

Take a look at https://docs.centreon.com/20.04/en/installation/prerequisites.html#centreon-server

Reply