1. 数据由默认路径换成 /home/dh/mysql2. cp -a 拷贝的数据文件,3. my.cnf中路径修改成了:
 datadir=/home/dh/mysql/
 socket=/home/dh/mysql/mysql.sock4. 新旧数据目录的权限都是mysql5. service mysqld start启动后提示:
Redirecting to /bin/systemctl start  mysqld.service
Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details.6. systemctl status mysqld.service后提示:
mysqld.service - MySQL Server
   Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since 五 2019-09-13 22:55:25 CST; 6s ago
     Docs: man:mysqld(8)
           http://dev.mysql.com/doc/refman/en/using-systemd.html
  Process: 28050 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
  Process: 28031 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
 Main PID: 24194 (code=exited, status=0/SUCCESS)9月 13 22:55:25 localhost.localdomain systemd[1]: Failed to start MySQL Server.
9月 13 22:55:25 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state.
9月 13 22:55:25 localhost.localdomain systemd[1]: mysqld.service failed.
9月 13 22:55:25 localhost.localdomain systemd[1]: mysqld.service holdoff time over, scheduling restart.
9月 13 22:55:25 localhost.localdomain systemd[1]: start request repeated too quickly for mysqld.service
9月 13 22:55:25 localhost.localdomain systemd[1]: Failed to start MySQL Server.
9月 13 22:55:25 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state.
9月 13 22:55:25 localhost.localdomain systemd[1]: mysqld.service failed.7. journalctl -xe后提示如下,好像一直有不同的IP在试图登录被拒:
9月 13 22:55:25 localhost.localdomain systemd[1]: Unit mysqld.service entered failed state.
9月 13 22:55:25 localhost.localdomain systemd[1]: mysqld.service failed.
9月 13 22:55:29 localhost.localdomain sshd[28054]: reverse mapping checking getaddrinfo for 192-227-252-17-host.colocrossing.com [192.
9月 13 22:55:29 localhost.localdomain sshd[28054]: Invalid user rust from 192.227.252.17
9月 13 22:55:29 localhost.localdomain sshd[28054]: input_userauth_request: invalid user rust [preauth]
9月 13 22:55:29 localhost.localdomain sshd[28054]: pam_unix(sshd:auth): check pass; user unknown
9月 13 22:55:29 localhost.localdomain sshd[28054]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= r
9月 13 22:55:31 localhost.localdomain sshd[28054]: Failed password for invalid user rust from 192.227.252.17 port 60142 ssh2
9月 13 22:55:31 localhost.localdomain sshd[28054]: Received disconnect from 192.227.252.17: 11: Bye Bye [preauth]
9月 13 22:55:39 localhost.localdomain sshd[28057]: Invalid user node123 from 165.227.0.220
9月 13 22:55:39 localhost.localdomain sshd[28057]: input_userauth_request: invalid user node123 [preauth]
9月 13 22:55:39 localhost.localdomain sshd[28057]: pam_unix(sshd:auth): check pass; user unknown
9月 13 22:55:39 localhost.localdomain sshd[28057]: pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= r
9月 13 22:55:41 localhost.localdomain sshd[28057]: Failed password for invalid user node123 from 165.227.0.220 port 41006 ssh2
9月 13 22:55:42 localhost.localdomain sshd[28057]: Received disconnect from 165.227.0.220: 11: Bye Bye [preauth]
9月 13 22:55:43 localhost.localdomain sshd[28059]: Invalid user www-data from 207.154.215.236
9月 13 22:55:43 localhost.localdomain sshd[28059]: input_userauth_request: invalid user www-data [preauth]
9月 13 22:55:43 localhost.localdomain sshd[28059]: pam_unix(sshd:auth): check pass; user unknown
-------------
网上查了一圈没有解决。
求各位大侠帮忙解决,不胜感激。