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