主机:
虚拟机
我的问题是:
我希望虚拟机访问Windows上的MySQL数据库。我试图通过在my.cnf文件中添加bind-address=192.168.0.142
来绑定地址。重新启动mysql服务后,它返回错误:Job for mysqld.service failed because the control process exited with error code. See "systemctl status mysqld.service" and "journalctl -xe" for details
。我忘了配置什么吗?
mysqld.service - MySQL Server
Loaded: loaded (/usr/lib/systemd/system/mysqld.service; enabled; vendor preset: disabled)
Active: deactivating (final-sigterm) (Result: exit-code) since Sat 2019-03-09 13:03:58 EST; 1min 24s ago
Docs: man:mysqld(8)
http://dev.mysql.com/doc/refman/en/using-systemd.html
Process: 45995 ExecStart=/usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid $MYSQLD_OPTS (code=exited, status=1/FAILURE)
Process: 45971 ExecStartPre=/usr/bin/mysqld_pre_systemd (code=exited, status=0/SUCCESS)
Main PID: 44232 (code=exited, status=0/SUCCESS)
Tasks: 4
CGroup: /system.slice/mysqld.service
└─45998 /usr/sbin/mysqld --daemonize --pid-file=/var/run/mysqld/mysqld.pid
Mar 09 13:05:20 localhost.localdomain systemd[1]: Starting MySQL Server...
Mar 09 13:05:21 localhost.localdomain systemd[1]: mysqld.service: control process exited, code=exited status=1
我所做的事情:
Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT tcp -- anywhere anywhere tcp dpt:opsession-prxy ACCEPT tcp -- 192.168.0.142 anywhere tcp dpt:opsession-prxy ACCEPT tcp -- anywhere anywhere tcp dpt:opsession-prxy ACCEPT tcp -- anywhere anywhere tcp dpt:mysql Chain FORWARD (policy ACCEPT) target prot opt source destination Chain OUTPUT (policy ACCEPT) target prot opt source destination
127.0.0.1
时没有问题,这意味着连接到虚拟机的MySQL。