这是因为jdbc连接的时候没有root权限。
如同我们非root权限时直接连接mysql一样,是连不进去的。
我们可以在localhost下创建另一个用户,要与‘root’不同,赋予其全部特权。
grant all privileges on *.* to 'lee'@'localhost' identified by '123456' with grant option;
我试过给root用户赋予特权,但是没什么用。
这是因为jdbc连接的时候没有root权限。
如同我们非root权限时直接连接mysql一样,是连不进去的。
我们可以在localhost下创建另一个用户,要与‘root’不同,赋予其全部特权。
grant all privileges on *.* to 'lee'@'localhost' identified by '123456' with grant option;
我试过给root用户赋予特权,但是没什么用。