Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

无法连接服务器 #9

Closed
ZainZhao opened this issue May 9, 2019 · 14 comments
Closed

无法连接服务器 #9

ZainZhao opened this issue May 9, 2019 · 14 comments

Comments

@ZainZhao
Copy link

ZainZhao commented May 9, 2019

你好,我部署之后访问index,显示无法连接服务器,这是什么原因呢

@ZainZhao
Copy link
Author

ZainZhao commented May 9, 2019

登录的时候也是一卡住,我修改了两个配置的数据库url,请问除了这个还要修改什么吗

@easepan
Copy link
Member

easepan commented May 9, 2019

数据库连接失败了吧,控制台有异常抛出吗

@ZainZhao
Copy link
Author

ZainZhao commented May 9, 2019

Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.

@ZainZhao
Copy link
Author

ZainZhao commented May 9, 2019

我换了一下驱动也没用

@ZainZhao
Copy link
Author

ZainZhao commented May 9, 2019

对了,我在导入sql的时候,只导入了efo.sql,在执行最后几行创建用户并授权的时候,报错了,我就没有执行,但是我在程序中改了连接的用户和密码,用root进行连接。除此之外,我的mysql是在虚拟机上的,但是我本地用navicat是可以直接连上的,防火墙应该没有问题

@ZainZhao
Copy link
Author

ZainZhao commented May 9, 2019

我现在不太清楚您写的两个配置文件中都有数据库的连接,我两个都进行了修改,都把usermane和pwd换为了mysql的root

@easepan
Copy link
Member

easepan commented May 9, 2019

sql 文件最后几行执行授权失败没啥关系的,改配置文件的用户名和密码就可以了,application.porperties通常是开发环境(默认),application-prod.properties 通常是生产环境,数据库能联通基本上也就没有啥问题了

@ZainZhao
Copy link
Author

ZainZhao commented May 9, 2019

我是初学spring boost ,是不是项目部署和运行的时候有错误,我仅仅maven build ,然后修改数据库连接,就直接运行了main,除此就没有修改什么了

@ZainZhao
Copy link
Author

ZainZhao commented May 9, 2019

有一条日志
Loading class com.mysql.jdbc.Driver'. This is deprecated. The new driver class is com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.

@ZainZhao
Copy link
Author

ZainZhao commented May 9, 2019

这个日志可能是我提高了jdbc的版本

@easepan
Copy link
Member

easepan commented May 9, 2019

这个我也不太清楚了,你的mysql不是5.7吧,只有多查资料了

@ZainZhao
Copy link
Author

ZainZhao commented May 9, 2019

好的,谢谢

@ZainZhao
Copy link
Author

ZainZhao commented May 9, 2019

再次麻烦一下,请问数据库连接的useSLL能不能变为false

@easepan
Copy link
Member

easepan commented May 9, 2019

可以的,连接条件都是可以修改的,只是有些情况可能会报警告

@easepan easepan closed this as completed May 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants