Zabbix导入MySQL数据库报错ERROR 1046 (3D000) at line 1: No database selected

使用如下命令导入Zabbix数据库时报错

解决办法:

1、先把原始的数据库压缩包备份

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

cd /usr/share/doc/zabbix-server-mysql-4.0.7/

2、解压数据库

gunzip create.sql.gz

3、安装nano编辑数据库信息

yum -y install nano

# 用nano打开编辑数据库信息

nano create.sql

# 在第一行加上

USE zabbix;

如下图所示:

Ctrl+x到达如下图的界面,输入y

这里直接回车

接着用gzip命令把create.sql文件压缩成.gz格式

gzip create.sql

然后重新导入MySQL数据库即可

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

原文地址:https://www.cnblogs.com/opsprobe/p/10812274.html

时间: 2024-08-25 10:36:44

Zabbix导入MySQL数据库报错ERROR 1046 (3D000) at line 1: No database selected的相关文章

数据库导入过大 报错 ERROR 2006 (HY000) at line xx: MySQL server has gone away 解决方法

解决办法 找到my.ini文件 修改my.cnf中的 wait_timeout 和 interactive_timeout变量 添加一句max_allowed_packet=16M,如果不行将16M再加大 加大wait_timeout也可起一定作用 例如: wait_timeout=2880000 interactive_timeout = 2880000 max_allowed_packet = 100M 应用时记住重启数据库哦-- 除此之外,可能还有一些别的buffer_size的变量会影响

mysql导入报错 ERROR 1286 (42000) at line 1: Unknown table engine 'InnoDB'

[[email protected] mysql]# mysql -u root -p'123456'  jiang < schema.sql                 ERROR 1286 (42000) at line 1: Unknown table engine 'InnoDB' mysql> select * from ENGINES; +------------+---------+-----------------------------------------------

Emoji表情符号录入MySQL数据库报错的解决方案

前言:手机app应用评论的时候,恢复表情符号,提示失败.?1,查看tomcat后台日志,核心报错信息如下:  Caused by: java.sql.SQLException: Incorrect string value: '\xF0\x9F\x98\x97\xF0\x9F...' for column 'CONTENT' at row 1at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1074)at com.mysql.

MySQL数据库报错pymysql.err.InterfaceError: (0, &#39;&#39;)

今天入库的时候出现了报错pymysql.err.InterfaceError: (0, ''),经过排查,发现是由于把连接数据库的代码放到了插入函数的外部,导致多线程运行出错 1 def write_into_db(data): 2 db = pymysql.connect(host=db_host, user=db_user, password=db_password, port=db_port, db=db_name, charset='utf8') 3 cursor = db.cursor

AndroidStudio导入Eclipse项目报错Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject

AndroidStudio导入Eclipse项目报错 Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject 错误原因: Gradle插件版本不一致导致,问题多出现在:eclipse项目转studio 解决步骤: https://blog.csdn.net/qq_21397217/article/details/65630730 原文地址:https://www

MySQL登录报错ERROR 2002 (HY000): Can&#39;t connect to local MySQL server through socket &#39;/tmp/mysql.sock&#39; (2)

[[email protected] mysql3307]# /opt/mysql3307/bin/mysql -upisp [email protected]123 mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.so

Navicat 连接MySQL数据库 报错2059 - authentication plugin &#39;caching_sha2_password&#39;的解决办法

#在数据库的命令行中输入以下代码即可解决,密码必须要修改 可以再次执行将密码改回来. use mysql; ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; Navicat 连接MySQL数据库 报错2059 - authentication plugin 'caching_sha2_password'的解决办法 原文地址:https://www.cnblogs.com/liuha

java插入数据至mysql数据库报错:check the manual that coresponds to your mysql server version for the right syntax to use near &#39;condition)values...解决方案

MySQL5.X(本地数据库) 使用java向表中插入数据时,每次数据库更新,pstm.executeUpdate();就会跳到IO报错,提示原因是sql语法有问题,如题可见 当测试插入数据不含condition字段时,插入成功,尝试更名为conDition时,仍报错 解决方案: 更改condition为conDi,原因可能时因为condition为数据库或java关键字不能使用,更名后不再受影响,插入成功. java插入数据至mysql数据库报错:check the manual that c

Python - - MySQL数据库 - - 报错锦集

注:环境配置信息,系统环境CentOS 7.4,数据库版本 mysql-5.7.24 1,跳过授权表 # 在命令行跳过授权表命令 mysqld_safe --skip-grant-tables & # 在 my.cnf 文件配置跳过授权表命令 [mysqld] skip-grant-tables 2,更改root密码 # 方法一: update mysql.user set authentication_string=password('root') where user='root' and