您的位置:首页 > 博客中心 > 数据库 >

Mysql:执行source sql脚本时,出现:error 2

时间:2022-03-14 18:40

Centos下部署mysql:

1、yum -y install mysql*;

2、service mysqld start;

3、chkconfig mysqld on;

4、设置用户名和密码:mysqladmin -uroot password123456

5、进入数据库:mysql -uroot -p 回车后,输入设置的密码

6、建立数据库:create database 数据库名;

7、切换到要使用的数据库

8、导入已写好的Sql:source  绝对路径/XX.sql;

这时,如果出现以下错误:

mysql> source /opt/openfire/database/openfire_mysql.sql;
ERROR:
Failed to open file ‘/opt/openfire/database/openfire_mysql.sql‘, error: 2

该Error的意思是说,没有找到该文件

排查方法:

1、有文件,但是,没有权限执行

2、有文件,路径不对

3、没有文件

热门排行

今日推荐

热门手游