0

I am trying to install Zabbix Server on Ubuntu 20.04.

I enter this command:

zcat /usr/share/doc/zabbix-sql-scripts/mysql/server.sql.gz | mysql -uzabbix -p Passw0rd 

But receive this error:

ERROR 1045 (28000): Access denied for user 'zabbix'@'localhost' (using password: YES)

How to find if my password is correct?

matigo
  • 24,752
  • 7
  • 50
  • 79

1 Answers1

0

When you create a MySQL account, the hostname is important. Many people will use something like 'zabbix'@'%', but this should be used only if the MySQL database is on a different physical server from the web application. For a local connection, you'll want to use 'zabbix'@'localhost'. Of course, there's no reason why you cannot use both.

Here's how:

  1. Connect to MySQL Server as an administrator (or as root). If doing this from Terminal, you can type:
    sudo mysql 
    
  2. Once connected to MySQL, create the user account:
    CREATE USER 'zabbix'@'localhost' IDENTIFIED WITH mysql_native_password BY 'superSecretPassword!123';
    
    Note: Be sure to replace superSecretPassword!123 with a proper password. You can reuse the same password as was used for 'zabbix'@'%' if you would like.
  3. Ensure the new account has all the permissions necessary to work with the necessary database(s):
    GRANT ALL ON `zabbix`.* TO 'zabbix'@'localhost';
    
  4. Disconnect from MySQL:
    exit 
    

That's all there is to it

matigo
  • 24,752
  • 7
  • 50
  • 79