mysql有关的。
报错1:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'
解决方案:
1:首先检查是否安装了mysql-server了
sudoapt-getinstall mysql-server to install mysql on ubuntu, 如果mysql-server已经存在了,那么在去尝试一下是否成功,如果还是这个错误的话那么就是文件/var/run/mysqld/mysqld.sock 不存在。
2:如果/var/run/mysqld/mysqld.sock文件不存在应该怎么办?
执行 vim /etc/mysql/my.cnf
## The MySQL database server configuration file.## You can copy this to one of:# - "/etc/mysql/my.cnf" to set global options,# - "~/.my.cnf" to set user-specific options.## One can use all long options that the program supports.# Run program with --help to get a list of available options and with# --print-defaults to see which it would actually understand and use.## For explanations see# http://dev.mysql.com/doc/mysql/en/server-system-variables.html## * IMPORTANT: Additional settings that can override those from this file!# The files must end with '.cnf', otherwise they'll be ignored.#!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mysql.conf.d/