The root of the problem is mysql installed by root and started by default./mysqld Restart reports the following error;
Mysql installation directory is: /usr/local/mysql/
[root@SHB-L0120796 bin]# ./mysqld restart
2020-03-06T09:02:19.361027Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2020-03-06T09:02:19.361168Z 0 [Note] --secure-file-priv is set to NULL. Operations related to importing and exporting data are disabled
2020-03-06T09:02:19.361213Z 0 [Note] ./mysqld (mysqld 5.7.27) starting as process 29670 ...
2020-03-06T09:02:19.364761Z 0 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
2020-03-06T09:02:19.364806Z 0 [ERROR] Aborting
2020-03-06T09:02:19.364835Z 0 [Note] Binlog end
2020-03-06T09:02:19.367170Z 0 [Note] ./mysqld: Shutdown complete
Temporary solutions:
Root /mysqld –user=root start in the installation directory /usr/local/mysql/bin using root:./mysqld –user=root start
./mysqld --user=root start
Or try /usr/local/mysql/bin under the installation directory:
service mysqld start
Best solution: Without modifying the my.cnF file, execute the following command line
./mysqld --skip-grant-tables --skip-networking --user=root &