一、错误现象:
cat /var/mysql/mysql.err
00:01:09 mysqld_safe Starting mysqld daemon with databases from /var/mysql
0:01:09 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
0:01:09 [Note] Event Scheduler: Loaded 0 events
0:01:09 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.73-log' socket: '/tmp/mysql.sock' port: 3306 Source distribution
00:06:42 mysqld_safe Starting mysqld daemon with databases from /var/mysql
0:06:42 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
0:06:42 [ERROR] Can't create IP socket: Permission denied
0:06:42 [ERROR] Aborting
0:06:42 [Note] /usr/libexec/mysqld: Shutdown complete
00:06:42 mysqld_safe mysqld from pid file /run/mysql/mysqld.pid ended
二、原因:
应该是mysqld的执行用户是mysql,然后无法使用root权限的内容。
三、解决办法:
cat /etc/my.cnf
......
# The MySQL server
[mysqld]
......
user=root
......
记得将 bind-address 设置为0.0.0.0 可以适用本地与外网访问