We previously talked about the SQLite database used by TSINGSEE Qinghica video development by default, and it is not recommended to replace the MySQL database because it may cause a series of problems after replacement. When some users start EasyNVR, they use mysql as a data source to start an error problem, as follows:
Analyze the error of the console during the startup: UNKNOW DRIVER “mysql” (forgotten import?), This error is to indicate that the driver file that is not connected to the MySQL data source is prompted.
So we checked the following code and found that the packet introduced in the initialization database did not introduce the driver package of mysql.
We configure the data source in Easynvr to check the introduced package. The place of EasynVR initialized database did not introduce the Drive package of mysql, so the driver package needs to be re -introduced.
mysql database GO driver installation steps are as follows:
Golang connected to the database user’s driver: Go-SQL-Driver
Installation method: Open the command line and execute the Go command:
go get -u github.com/go-sql-driver/mysql
import (
"fmt"
"gitee.com/easydarwin/EasyNVRGo/models"
_ "github.com/go-sql-driver/mysql"
"github.com/jinzhu/gorm"
"github.com/penggy/EasyGoLib/utils"
"time"
)
Solving the effect, and successfully started with MySQL data source.
If you encounter problems during the Mysql database migration process, you can refer toMySQL Data Source How to deal with Gorm’s automatic migration database table to report an error. For more solutions about Easynvr or other video platforms, please contact us to understand.