android怎么用JDBC方法連接mysql數(shù)據(jù)庫?
1,驅(qū)動配置有誤:driver=com.mysql.jdbc.Driver2,數(shù)據(jù)庫連接地址有誤:url=jdbc:mysql://localhost:3306/test?3useUnicode=true&characterEncoding=utf83,密碼或帳號有誤:username=rootpassword=root4,數(shù)據(jù)庫未啟動或無權(quán)訪問5,項目未引入對應(yīng)的驅(qū)動jar包mysql-connector-java-5.1.6-bin.jar6,mysqlroot沒有遠(yuǎn)程訪問的權(quán)限,需要增加權(quán)限,增加權(quán)限的步驟如下:進(jìn)入mysql數(shù)據(jù)庫:grantallprivilegeson*.*to'root'@'%'identifiedby'root'withgrantoption;flushprivileges;7.jdbc驅(qū)動要放到j(luò)re里面。