In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
The Web project is deployed using the root password of the root account. It can be successfully released when loaded to the Tomcat server through Eclipse. If it is packed into a war package and placed in the webapps directory of tomcat, it cannot be published successfully. An error was reported:
Jdbc.properties involves Mysql configuration:
The error is obvious, related to the MySQL password, but the jdbc.properties configuration file used by the project is the same in both ways. So it is definitely not caused by the wrong password, so I have to find du Niang, O (∩ _ ∩) O ~.
Most online posts also report this error when they log in by running the mysql-u root-p command, so I try to log in this way to see if there is the same problem.
After checking the information, the reason is that the root account does not open remote access by default, so you need to modify the relevant permissions.
Solution:
Method 1:
1. Open the my.ini file in the MySQL directory, add a line "skip-grant-tables" at the end of the file, save and close the file. (WIN7 is installed by default, and my.ini is installed at C:\ ProgramData\ MySQL\ MySQL Server 5.6)
two。 Restart the MySQL service.
3. Enter the BIN directory of MySQL through the command line, enter "mysql-u root-p" (no password), and enter to enter the database. (WIN7 is installed by default, and the BIN directory is C:\ Program Files\ MySQL\ MySQL Server 5.6\ bin)
4. Execute "use mysql;" and use the mysql database.
5. Execute "update user set authentication_string=PASSWORD (" admin ") where user='root';" (change the password of root)
6. Open the my.ini file in the MySQL directory, delete the "skip-grant-tables" on the last line, save and close the file.
In the previous steps, you can also change the root password directly through the mysql client tool. (figure)
7. Restart the MySQL service.
8. Enter "mysql-u root-padmin" on the command line to successfully connect to the database.
Complete the above steps, modify the jdbc.properties configuration, Eclipse and war packages can be successfully deployed to the tomcat server. The problem is finally solved.
Appendix method II:
1. The administrator logs in to the system, stops the mysql service or ends the mysqld-nt process
two。 Enter the command line and go to the directory where mysql is installed. Suppose the installation directory is d:\ mysql\, and CMD enters the command line
3. Run D:\ Program Files\ MySQL\ MySQL Server 5.5\ bin\ mysqld-nt-- skip-grant-tables starts mysql and turns off the permission check
4. Run D:\ Program Files\ MySQL\ MySQL Server 5.5\ bin\ mysqladmin-u root flush-privileges password "newpassword" to reset the root password
5. Restart the mysql service
Interlude:
In the process of solving the problem, according to the online description, visit mysql through mysql-u root-p password, and the result is as follows:
But the strange thing is that I typed this command right or dead. It will ask for the password again, and then return "ERROR 1049 (42000): Unknown database '123456'"
The error is obvious that the password after our-P represents the database name. But with the parameter-p, p should represent password. Baidu later found that-p and password are linked together.
Mysql-h localhost-u root-ppassword
-p and password are linked together, try it quickly, you can log in as expected!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.