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