我是编程世界的初学者:两天来一直在谷歌搜索并尝试很多东西......但没有解决方案。 为 LAMP 安装了 cptserver,用于虚拟机(Git、vagrant、puppet):https://github.com/pigeontech/cptserver
当我尝试启动 Mysql 时,出现以下错误:
vagrant@localhost:~$ /usr/bin/mysqld_safe &
[1] 3404 vagrant@localhost:~$ 160311 01:02:50 mysqld_safe Can't log to error log and syslog at the same time.
Remove all --log-error configuration options for --syslog to take effect.
160311 01:02:50 mysqld_safe Logging to '/var/log/mysql/error.log'.
touch: cannot touch ‘/var/log/mysql/error.log’: Permission denied
chmod: cannot access ‘/var/log/mysql/error.log’: Permission denied
cat: /var/run/mysqld/mysqld.pid: Permission denied
rm: cannot remove ‘/var/run/mysqld/mysqld.pid’: Permission denied
160311 01:02:50 mysqld_safe Fatal error: Can't remove the pid file: /var/run/mysqld/mysqld.pid
Please remove it manually and start /usr/bin/mysqld_safe again; mysqld daemon not started
/usr/bin/mysqld_safe: 126: /usr/bin/mysqld_safe: cannot create /var/log/mysql/error.log: Permission denied
vagrant@localhost:~$ [1]+ Exit 1
/usr/bin/mysqld_safe
有人可以向我展示一种简单的解决方案吗?
最佳答案
最后我可以通过以下步骤解决:
$ sudo mysql_install_db
/usr/bin/mysql_secure_installation
$ sudo /usr/bin/mysqld_safe &
打开一个新窗口(Alt + F2)并将光标移至 vagrant@localhost:~$
然后,通过以下方式打开MySQL:
$ sudo /usr/bin/mysql -u root -p mysql
关于mysql - 流浪者@localhost :~$/usr/bin/mysqld_safe & not working,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35931697/