用java开发总是会遇到这样或者那样的问题,不过出乎我意料的是第一个大问题来的这么快。从昨天下午1点到晚上9.30一直在测试,查资料结果还是不行!今天下午试了一下可以了?!!如释重负。java开发,一直在路上,,,, 用myclipse开发java,由于要用到数据库,于是添加jdbc,由于我也是刚从c/c++转到java开发,不是很熟悉。所以我只说一下我遇到的问题和我怎么解决的! 一,环境 1,编程语言:java(jre1.6) 2,开发环境:myclispe(10.0) 3,数据库:mysql5.7 4,工具:navicat 5,操作系统:win7 6,电脑:dell 二,问题是什么? : 这是开机出现的
This is after clicking on the OK that appears above
This is the cmd command line, and with the Mysql5.7command, there will be a flash back
(http://img.blog.csdn.net/20160428165135075)
4[This is the screen that appears when you connect to the database with Navicat]
In the Myclipse connection to MySQL (that is, with Myclipse project to add JDBC, to use the program to operate the database, that is, to connect Myclipse and Navicat), the implementation of Java program database purposes.
In writing the program first you want to detect whether your Myclispe and navicat connection is not, so write code. However, the operation was found to be incorrect and there was no successful connection. So find the reason, first go to navicat see, open navicat found the following tips:
[At that time the heart collapsed]
Then go to cmd input password, found wrong. So I began my journey of discovery.
First, the MySQL database is not uninstalled, I yesterday 1 o'clock in the afternoon to 9 o'clock has been testing the root method, including unloading the database, reinstall Navicat, almost unloaded myclipse, reinstall Win7. Try to uninstall MySQL, found no, the direct reload will error, the specific picture forgot to cut (sorry). And someone's like me. Uninstall MySQL results are miserable, the database unloading is not clean and reload (this is not the result of clean uninstall). There is also the database error can not be solved, I went to the official website to see a bit, did not read, but although the database is connected, if everyone who has a way to resolve please leave a message! Next reload Navicat no use! Navicat I tried 5 times yesterday to reload, and then eggs. And do not blindly look at the results of the Internet, according to your own situation of their own thinking (including my this article). Yesterday I put a lot of online information about the Navicat,mysql database, Myclipse blog, the connection document turned the bottom slot days no use. It's all a damn nonsense. The online solution is summarized as follows: 1 For example, someone asked you to find what My.ini file to change what this mysqld, change the port (say is to change ports 3306 for other), the results I almost changed the My.ini file "rotten", no use. 2 Someone let you in the CMD to change what authorization, and enter what Mysql-u,,,,, (omit a lot of characters)-p, still no use. 3 Someone let you use the user table to manipulate something, I believe, and then I have to change that, almost collapsed if you are in my case, ignore the above online solution. What do we do? Calm down. First go to Mysqlcommandlineclient, find him, enter the password. Don't worry, try the passwords you think of, especially if you've changed them. Actually turn off the window later. Appears as follows: [Password really is like this]
Then go to open navicat, name with your previous name, don't use what 127.0.0.1. Enter the password for MySQL input using the name of the previous useful time.
[The small dolphin turns into this green is connected.]
It's a success now.
Finally, I solved the connection problem by accident "Harvest".
Where is the My.ini file?
In your MySQL installation directory. Usually in the C-drive program files in the MySQL folder in MySQL sever5.7. You can see a: My-default.ini document. Open with Notepad, do not try to modify, (I changed). After the modification of the contents of the inside, we have to remove the "#" of the changed things. Useful may be the error log, there are legin or something. Generally not used.
Where is the my.cnf file?
If you're win7, you can't find it. He's a Linux system. Equivalent to the My.ini in Win7. So don't look for it.
Delete my.ini file?
Do not delete, delete, my problem is not resolved anyway. I suspect you have deleted it and your problem may not be solved.
This is the last day I've been working on. Finally, the age of information sharing is now.
I write this also in order to hope to have the same as I "rookie" can be less detours.
Welcome message and Discussion!
[Email protected]
Connect Navicat with Myclipse (MySQL database)