1

I followed the instruction to install zabbix_server_mysql 3.2 in Ubuntu16.

wget http://repo.zabbix.com/zabbix/3.2/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.2-1+xenial_all.deb
dpkg -i zabbix-release_3.2-1+xenial_all.deb
apt-get update
apt-get install zabbix-server-mysql zabbix-frontend-php

After complete to install, I try to connect mysql for the next instruction like below.

Creating initial database

Create Zabbix database and user on MySQL by the following commands, where <root_password> shall be replaced with the actual root password (e.g., shell> mysql -uroot -p12345) and <password> with new password for zabbix user on the database (including apostrophes: …identified by '67890';):

shell> mysql -uroot -p<root_password>
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhost identified by '<password>';
mysql> quit;

It is saying I need to type the actual root's password even though I have never set root password while installing zabbix_server_mysql.

At the first I tried to assume default password like empty string "", "root" and "zabbix" something.

Then I tried to change root password to what I want.

$sudo service mysql stop
$sudo mysqld_safe --skip-grant-tables

# Another terminal
$mysql -uroot mysql
mysql > update user set password=PASSWORD("root") where User='root';
mysql > flush privileges;
mysql > quit;
$ sudo service mysql restart
$ mysql -uroot -proot
ERROR 1698 (28000): Access denied for user 'root'@'localhost'

Unfortunately, these seem not to work as I don't know why.

I have been stuck for quite long time, even not starting zabbix at all.

Could you give me an advice ?

Edit -------------------------------------------------

dpkg -l | grep mysql
ii  libdbd-mysql-perl                     4.033-1ubuntu0.1                                            amd64        Perl5 database interface to the MySQL database
ii  libmysqlclient20:amd64                5.7.17-0ubuntu0.16.04.1                                     amd64        MySQL database client library
ii  mysql-common                          5.7.17-0ubuntu0.16.04.1                                     all          MySQL database common files, e.g. /etc/mysql/my.cnf
ii  php-mysql                             1:7.0+35ubuntu6                                             all          MySQL module for PHP [default]
ii  php7.0-mysql                          7.0.13-0ubuntu0.16.04.1                                     amd64        MySQL module for PHP
ii  zabbix-server-mysql                   1:3.2.3-1+xenial                                            amd64        Zabbix network monitoring solution - server (MySQL)
asleea
  • 159
  • 1
  • 1
  • 8
  • Did you try `sudo dpkg-reconfigure mysql-server-version`? Replace "version" with something like 5.6. – Khaled Jan 31 '17 at 16:53
  • @Khaled `sudo dpkg-reconfigure` shows only `mysql-common` is available for `mysql` and it doesn't have any effect with `mysql-common`. – asleea Feb 01 '17 at 08:53
  • No `mysql-server` package!? How did you install mysql server? – Khaled Feb 01 '17 at 08:55
  • @Khaled I didn't install `mysql` separately, it seems `zabbix_server_mysql` to install it together, that is why I am asking it on `server fault` if there is default password `zabbix_server_mysql` set for `root` user while installing it. – asleea Feb 01 '17 at 09:10
  • Can you post the output of `dpkg -l | grep mysql`? – Khaled Feb 01 '17 at 09:13
  • @Khaled I edit my post adding result of `dpkg -l | grep mysql`. – asleea Feb 01 '17 at 09:19
  • No, there is not a default password; you set one explicitly when you install MySQL. – Michael Hampton Feb 01 '17 at 09:21

2 Answers2

2

zabbix-mysql-server will install mysql (or mariadb) if it's not installed yet on your system, as it is a dependency, but it will not provide a default root password.

Once your installation of mysql is done, try launching

mysql_secure_installation

and you'll be able to set the root password of your MySQL installation.

Only after this, you can follow the documentation to create the db, user, etc..

The Zabbix documentation, the way it is written, is assuming that your MySQL is already installed and properly configured. In your situation, it's not done.

SBO
  • 524
  • 4
  • 12
  • `mysql_secure_installation` still ask me root password even though it is saying `If you've just installed MariaDB, and you haven't set the root password yet, the password will be blank, so you should just press enter here.` blank doesn't work......... – asleea Feb 01 '17 at 10:50
  • Because you've changed it, right ? If you want to do a "fresh" install and start over, try this : apt-get --yes purge mysql-server mysql-client && apt-get --yes autoremove --purge && apt-get autoclean then reinstall mysql-server and try again, you should be fine. – SBO Feb 01 '17 at 10:53
  • Is it now solved ? – SBO Feb 07 '17 at 15:47
  • Thank you for your attention but It was still the same, finally I just installed `mysql` separately and it worked. – asleea Feb 08 '17 at 12:07
-1

I fixed this problem:
type sudo -i then type you root password. after that

# mysql -uroot -p 

and enter you root system password. And its all :)

Thomas
  • 4,155
  • 5
  • 21
  • 28