-
數(shù)據(jù)庫無法連接的常見原因:
1. 沒有引入數(shù)據(jù)庫連接jar包
? ? 解決辦法:project struture->moudules->dependencies->+相應(yīng)的jar包
2. 驅(qū)動配置有誤:driver=com.mysql.jdbc.Driver?
3. 數(shù)據(jù)庫連接地址有誤:url=jdbc:mysql://localhost:3306/database_name?
4. 數(shù)據(jù)庫密碼或帳號有誤?
5. 數(shù)據(jù)庫未啟動或無權(quán)訪問?
6. mysql root沒有遠程訪問的權(quán)限,需要增加權(quán)限,增加權(quán)限的步驟如下:?
進入mysql數(shù)據(jù)庫:?
grant all privileges on . to ‘root’@’%’ identified by ‘root’ with grant option;?
flush privileges;
mybatis中mapper里已經(jīng)設(shè)置了sid自增,但insert仍出現(xiàn)sid不能為空的錯誤
解決:1. sid類型需為int
? ? ? ? ? 2. 需在navicat中:表shouse->sid->勾選”自動自增“
查看全部 -
AreaDao.xml
查看全部 -
entity:Area
查看全部 -
AreaDao
查看全部 -
SessionFactory更正
查看全部 -
properties
查看全部 -
SessionFactoryConfiguration
查看全部 -
DataSourceConfiguration
查看全部 -
properties
查看全部 -
properties.url
查看全部 -
mybatis-config.xml
查看全部 -
pom.xml
查看全部 -
實體類Area
查看全部 -
tb_area.table.sql
查看全部 -
頁面-美食飲品
查看全部
舉報