Today, when deploying a Java EE project under Linux, the MySQL database is always not connected, and the configuration of the connection pool is determined to be right after the check, and the Mysql-uname-ppassword connection is always reported to access denied after entering the Linux server For user ' root ' @ ' localhost ' (using Password:yes "), the final solution to this problem is still not connected (see: http://www.cnblogs.com/qlqwjy/p/8315802.html).
Resolved after the SQLyog connection in the local error, but the Linux server can be run, with the following statement after authorization or not connected, and the Java program is not connected
Authorized:
Mysql> Grant All Privileges on *.* to 'Root'@'%'Identified by 'Admin'; MySQL> Grant All Privileges on *.* to 'Root'@'localhost'Identified by 'Admin'; MySQL>FlushPrivileges;
To view logged-in user information:
MySQL>Selectuser, Host,password from MySQL. User;
At this time with service Myqld Stop discovery does not work, that is, the MySQL service cannot be shut down, with service mysqld start error:
Starting mysqld (via Systemctl): For, and - for details.
Finally, by looking at the MySQL error log, the MySQL service has been turned on:
Mysql>Show variables like 'Error_log'; EmptySet(0.00sec) MySQL>Show variables like 'Log_error';+---------------+---------------------+|Variable_name|Value|+---------------+---------------------+|Log_error| /var/Log/Mysqld.Log |+---------------+---------------------+1Rowinch Set(0.00sec) MySQL>Quitbye[[email protected] logs]# Cat/var/Log/Mysqld.Log
Error log:
180119 Ten: on: *Mysqld_safe Logging to '/var/log/mysqld.log'.180119 Ten: on: *Mysqld_safe A mysqld Process alreadyexists180119 Ten: on:Panax NotoginsengMysqld_safe Logging to '/var/log/mysqld.log'.180119 Ten: on:Panax NotoginsengMysqld_safe A mysqld Process alreadyexists180119 Ten: on: -Mysqld_safe Logging to '/var/log/mysqld.log'.180119 Ten: on: -Mysqld_safe A mysqld Process alreadyexists
Workaround: Finally, the MySQL solution is restarted by looking at the MySQL-related PID and then killing the process:
[[email protected] logs]# PS-Ef|grep mysqlmysql24359 1 0 Ten: to?xx:xx:xx /Bin/Sh/Usr/Bin/Mysqld_safe--basedir=/usrMysql24541 24359 0 Ten: to?xx:xx: on /Usr/Sbin/Mysqld--basedir=/usr--datadir=/var/lib/mysql--plugin-dir=/usr/lib64/mysql/plugin--log-error=/var/log/mysqld.log-- Pid-file=/var/run/mysqld/mysqld.pid--socket=/var/lib/mysql/mysql.sockRoot25420 25023 0 One: -Pts/2 xx:xx:xxGrep--Color=auto MySQL[[email protected] logs]#Kill -9 24541[[email protected] logs]#Kill -9 24359
After viewing the MySQL-related process ID with the above command, kill the process and restart the MySQL service to find everything is OK.
[[email protected] logs]# service mysqld start
Linux under program JDBC Connection not to MySQL database