Error querying database. Cause:org.springframework.jdbc.CannotGetJdbcConnectionException:Could not get JDBC Connection

Source: Internet
Author: User

Problem: Maintenance Team original Java project, Spring + MyBatis. Restart the project after restarting the machine, Tomcat has started, reported the following error

Solve:

Based on error information about database, MySQL execution on Linux, error

which MySQL sh xx/bin/mysqld_safe   # XX for installation address

No problem executing MySQL, project still error. MySQL Statement link project use database, error; link to another database that can be linked

Go to the MySQL folder used in the directory where the project is located, execute SH xx/bin/mysqld_safe

Comb:

MySQL as a basic environment, the use of the environment has been installed, school Learning database related also forgotten, comb it.

[MySQL and Mysqld]

  MySQL   (sometimes referred to as the  "terminal Monitor"  or just  " monitor ") is an interactive program that enables your to connect to a MySQL server, run queries, and VI EW the Results.  MySQL  may also be used in batch mode:you place y Our queries in a file beforehand, then tell  MySQL  to Execute The contents of the file. Both Ways of Using  MySQL  are covered here. Simple understanding of MySQL as a statement

mysqld , also known as MySQL Server, is the main program, which does most of the work in a MySQL installation. MySQL Server manages access to the MySQL data directory, that contains databases and tables. The data directory is also the default location for other information such as log files and status Files.mysqld as background server, All clients need to connect through mysqld

Mysqld_safe is the recommended-to-start a mysqld server on Unix. Mysqld_safe adds some safety features such as restarting the server when an error occurs and logging runtime info Rmation to an error log. start the mysqld script, read the ETC/MY.COF in the corresponding directory

"Cannot connect"

A MySQL Client on Unix can connect to the mysqld server in both different ways: by using a UNIX socket file to Connect through a file in the file system (default /tmp/mysql.sock ), or by using TCP/IP, which connects through a portnumber. A Unix Socket file connection is faster than TCP/IP, but can be used if connecting to a server on the same compute R. A Unix socket file is used if specify A host name or if you specify the special host name localhost .

Https://dev.mysql.com/doc/refman/5.7/en/can-not-connect-to-server.html

Error querying database. Cause:org.springframework.jdbc.CannotGetJdbcConnectionException:Could not get JDBC Connection

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.