A ResourcePool could not acquire a resource from its primary factory or source

今天在写一个 spring 整合的小demo,出现了一个小错误

A ResourcePool could not acquire a resource from its primary factory or source,按照其他大佬的说法,可能是以下原因,但我自己用了他们给的那几种说法,还是没能解决问题,最后才发现是数据库连接的时候错误了,话不多说,上图。

A ResourcePool could not acquire a resource from its primary factory or source_第1张图片

于是打开了数据库,发现既然出错了!!!

A ResourcePool could not acquire a resource from its primary factory or source_第2张图片

解决办法:

1、打开命令行,输入 mysql -uroot -p

A ResourcePool could not acquire a resource from its primary factory or source_第3张图片

2、发现数据库果然有错误,打开计算机管理,如图,在 MySQL 那右键,选择启动

A ResourcePool could not acquire a resource from its primary factory or source_第4张图片

3、重新再命令行输入 mysql -uroot -p,发现就好啦

A ResourcePool could not acquire a resource from its primary factory or source_第5张图片

你可能感兴趣的:(连接数据库常见问题)