Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
MySQL服务器未在Raspberry Pi上启动_Mysql_Linux_Raspberry Pi - Fatal编程技术网

MySQL服务器未在Raspberry Pi上启动

MySQL服务器未在Raspberry Pi上启动,mysql,linux,raspberry-pi,Mysql,Linux,Raspberry Pi,我正在使用运行DebianLinux的Raspberry Pi。我正在尝试安装MySQL服务器并运行它,下面是我所做的: # sudo apt-get install mysql-server mysql-client php5-mysql 没有错误。现在我重新启动了系统,启动时我得到: [FAIL] startpar: service(s) returned failure: mysql ... failed! 我试过了 # sudo service mysql start mysql:

我正在使用运行DebianLinux的Raspberry Pi。我正在尝试安装MySQL服务器并运行它,下面是我所做的:

# sudo apt-get install mysql-server mysql-client php5-mysql
没有错误。现在我重新启动了系统,启动时我得到:

[FAIL] startpar: service(s) returned failure: mysql ... failed!
我试过了

# sudo service mysql start
mysql: unrecognized service
最后我试了一下

# /etc/init.d; mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
我发现在/var/run中没有名为mysqld
的文件夹。但是我读到这里的sock文件应该在第一次创建服务器时创建

你有什么建议吗

/etc/init.d; mysql
通常启动mysql服务器的方法是

/etc/init.d/mysqld start

失败的原因应该写入日志(通常是/var/log/mysqld.log)-日志会说什么?

看起来您的mysql服务器没有启动。我通常运行stop命令,然后再次启动它:

mysqld stop
mysql.server start

同样的错误,这对我也适用。

查看/var/log/mysql/error.log

创建文件夹,并确保mysql用户look in/etc/init.d可以写入该文件夹,以查看启动/停止脚本的调用。可能是“mysqld”。。。查看/var/log/syslog以及mysql日志的任何位置,看看它失败的原因。它是开箱即用的。您使用的是哪个raspbian版本?我正在运行debian版本3.2.27。启动/停止脚本是“mysql”。我创建了这个目录,但仍然需要一个.sock文件,这也让mysql感到高兴。检查系统日志似乎没有任何帮助,因为当我尝试运行服务器时,它不会改变:p