在 mysql 里运行如下两句命令 grant all privileges on *.* to root@"%" identified by "."; flush privileges; 然后 java 程序即可正常运行