当前位置:Gxlcms > 数据库问题 > Mysql:执行source sql脚本时,出现:error 2

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

时间:2021-07-01 10:21:17 帮助过:2人阅读

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、没有文件

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

标签:

人气教程排行