Zabbix import MySQL database error ERROR 1046 (3D000) at line 1: No database selected

An error is reported when importing the Zabbix database using the following command

Solution:

Edit the database file to be imported

vim /usr/share/doc/zabbix-server-mysql-4.0.7/create.sql.gz

# Add in the first line

use zabbix;

As shown below:

Save and exit!

Then re-import the MySQL database. Note: The import process may take a few seconds.

zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -u zabbix -p


Read More:

Leave a Reply

Your email address will not be published. Required fields are marked *