Centos下部署mysql:mysql
一、yum -y install mysql*;sql
二、service mysqld start;數據庫
三、chkconfig mysqld on;部署
四、設置用戶名和密碼:mysqladmin -uroot password123456file
五、進入數據庫:mysql -uroot -p 回車後,輸入設置的密碼service
六、創建數據庫:create database 數據庫名;權限
七、切換到要使用的數據庫密碼
八、導入已寫好的Sql:source 絕對路徑/XX.sql;方法
這時,若是出現如下錯誤:yum
mysql> source /opt/openfire/database/openfire_mysql.sql;
ERROR:
Failed to open file '/opt/openfire/database/openfire_mysql.sql', error: 2
該Error的意思是說,沒有找到該文件
排查方法:
一、有文件,可是,沒有權限執行
二、有文件,路徑不對
三、沒有文件