MySQL 实际问题是什么?数据库?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/34590652/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the actual issue? MySql?
提问by 0xtimur
Hello, I have been trying to solve this problem for many days with no resolve. I am a BEGINNER, so dim things done for me, please. My question is what is the problem, there are many stones to turn over from my perspective. Just need to be shown in the right direction.
您好,我已经尝试解决这个问题很多天了,但没有解决。我是初学者,请为我做些微不足道的事情。我的问题是有什么问题,从我的角度来看,有很多石头要翻。只需要显示在正确的方向。
I have completely restarted my computer and uninstall the mysql at least 4x. I have invested a lot of time in trying to figure this out. Too much timehas been put in this. So any help is truly appreciated. The answer might be something I might not know I had to do but is obviouse. Like to install something.
我已经完全重新启动了我的计算机并至少卸载了 4 次 mysql。我已经投入了大量时间试图解决这个问题。在这方面投入了太多时间。所以任何帮助真的很感激。答案可能是一些我可能不知道我必须做的,但obviouse。喜欢装东西。
Computer status:
电脑状态:
Mac El Captain, MySQL 5.7, Netbeans 8.1, Tomcat 8.0 (told not install the latest version), Connect/J (might have not set this up correctly)
Mac El Captain、MySQL 5.7、Netbeans 8.1、Tomcat 8.0(被告知不要安装最新版本)、Connect/J(可能没有正确设置)
I followed these instruction https://netbeans.org/kb/docs/ide/mysql.html. When I establishing a new connection on Netbeans, I have tested the connection and it was successful. I created a database on my Netbeans and I see it on my command line what I do show databases;
我遵循了这些说明https://netbeans.org/kb/docs/ide/mysql.html。当我在 Netbeans 上建立新连接时,我已经测试了连接并且成功了。我在我的 Netbeans 上创建了一个数据库,我在命令行上看到了我显示数据库的内容;
I don't think I have done anything wrong, I think I have something simply missing.
我不认为我做错了什么,我认为我只是缺少一些东西。
Error MessagesWhen Clean and Building a project on NetBeans that has tests using mysql.
在使用 mysql 进行测试的 NetBeans 上清理和构建项目时出现错误消息。
1.
1.
Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification. Jan 04, 2016 11:46:29 AM org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
不建议在没有服务器身份验证的情况下建立 SSL 连接。根据 MySQL 5.5.45+、5.6.26+ 和 5.7.6+ 要求,如果未设置显式选项,则必须默认建立 SSL 连接。为了符合不使用 SSL 的现有应用程序,verifyServerCertificate 属性设置为“false”。您需要通过设置 useSSL=false 来显式禁用 SSL,或者设置 useSSL=true 并为服务器证书验证提供信任库。2016 年 1 月 4 日上午 11:46:29 org.springframework.context.support.ClassPathXmlApplicationContext prepareRefresh
2.
2.
Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Access denied for user 'root'@'localhost' (using password: YES))
无法获得 JDBC 连接;嵌套异常是 org.apache.commons.dbcp.SQLNestedException:无法创建 PoolableConnectionFactory(用户“root”@“localhost”的访问被拒绝(使用密码:YES))
I want the possible problems, the direction I need to look at.
我想要可能的问题,我需要看的方向。
Error Message 1.I have not found any solution on the net yet for this, any links would be helpful.
错误消息 1。我还没有在网上找到任何解决方案,任何链接都会有所帮助。
Error Message 2.I have gone to every corner of the web figuring this problem out and no luck.
错误消息 2。我已经走遍了网络的各个角落,想解决这个问题,但没有走运。
I have reset my password of root@localhost to root I have flushed my privileges I have done this every conceivable way and in a remarkable amount of times. And whole lot of other things. I can log in normal using mysql -u root -p and then entering my root password.
我已经将 root@localhost 的密码重置为 root 我已经刷新了我的权限我已经以各种可能的方式并且以惊人的次数这样做了。还有很多其他的东西。我可以使用 mysql -u root -p 正常登录,然后输入我的 root 密码。
I just need need to know what doors there are and which are most likely the problem.
我只需要知道有哪些门,哪些最有可能是问题所在。
Here is a pic that might help: pic
Side Question: my.cnf file of MySql is it still a file in the new version of MySQL? I have read about it, my computer does not have it. I am assuming it was there in the older versions.
边问:MySql的my.cnf文件在新版本的MySQL中还是一个文件吗?我读过它,我的电脑没有它。我假设它在旧版本中存在。
采纳答案by O. Jones
The first error is complaining about an SSL connection from your Netbeans to your MySQL. It seems NetBeans's default is to use SSL. That means you have two choices:
第一个错误是抱怨从 Netbeans 到 MySQL 的 SSL 连接。似乎 NetBeans 的默认设置是使用 SSL。这意味着你有两个选择:
- Switch off SSL. This is the better choice if your 'beans machines and your MySQL server are in the same data center.
- Configure your MySQL with the appropriate private cert and configure 'beans with the necessary certs.
- 关闭 SSL。如果您的 'beans 机器和您的 MySQL 服务器在同一个数据中心,这是更好的选择。
- 使用适当的私有证书配置您的 MySQL,并使用必要的证书配置 'beans。
To try to do #1, your JDBC connection string (the text string telling 'beans where your MySQL server is located and how to connect to it) needs to carry a particular property value. That is, the useSSL
property needs to have a value of false
. If you're setting up the connection string using the glassfish GUI, you'll find a screen where you can Add.. this property as one of several to the connection string.
要尝试执行 #1,您的 JDBC 连接字符串(告诉 'beans 您的 MySQL 服务器位于何处以及如何连接到它的文本字符串)需要携带一个特定的属性值。也就是说,该useSSL
属性的值需要为false
。如果您使用 glassfish GUI 设置连接字符串,您会发现一个屏幕,您可以在其中添加..此属性作为连接字符串的几个属性之一。
See Step 6 of this procedure: https://netbeans.org/kb/docs/web/mysql-webapp.html#prepareCommunication
请参阅此过程的第 6 步:https: //netbeans.org/kb/docs/web/mysql-webapp.html#prepareCommunication
Properties are easy to append to connection strings. Simply append &useSSL=false
to the string.
属性很容易附加到连接字符串。只需附加&useSSL=false
到字符串。
Get your first error solved first, then attempt to solve the second one.
先解决第一个错误,然后尝试解决第二个错误。
回答by Eassa Nassar
i added useSSL=false
and it worked
我添加了useSSL=false
,它起作用了
db.mysql.url="jdbc:mysql://localhost/db?characterEncoding=UTF-8&useSSL=false"
回答by Mala
If the connection url is db.mysql.url="jdbc:mysql://localhost/db"
,
then do db.mysql.url="jdbc:mysql://localhost/db?useSSL=false"
如果连接 url 是db.mysql.url="jdbc:mysql://localhost/db"
,则执行db.mysql.url="jdbc:mysql://localhost/db?useSSL=false"