mysql - 流浪者@localhost :~$/usr/bin/mysqld_safe & not working

标签 mysql ubuntu lamp

我是编程世界的初学者:两天来一直在谷歌搜索并尝试很多东西......但没有解决方案。 为 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/

相关文章:

mysql - 使用 R Shiny 中的 rfm 包进行新近度、频率和货币值(value)分析

mysql - Java FXML - NetBeans - 从表中删除 - MySQL

ubuntu - Bower 找不到 Git 安装

ubuntu - cp : not writing through dangling symlink '/usr/lib/x86_64-linux-gnu/libhdf5.so'

PHP fopen、fwrite 和 fclose 继续没有错误,但没有创建文件

php - linux下彻底清除apache2

php - 在 MySQL/PHP 中为变量留出空格

MySQL 存储过程并且仅在特定条件下更新

ubuntu - 在亚马逊上安装 ejabberd

php - 无法让我的 mysql_query() 在我的 php 脚本中工作