MySQL 未在 Linux 上启动

Man*_*oop 4 linux mysql

我需要使用 SUSE 版本 11 发行版为我的 linux 2.16 版本运行 MySQL 服务。下载以下文件并安装所有 rpms 如下:

MySQL-server-5.5.27-1.sles11.i586
MySQL-client-5.5.27-1.sles11.i586
MySQL-devel-5.5.27-1.sles11.i586
MySQL-shared-5.5.27-1.sles11.i586
MySQL-shared-compat-5.5.27-1.sles11.i586
Run Code Online (Sandbox Code Playgroud)

安装过程中没有错误,我已经通过以下方式确认了已安装的软件包:

rpm -qa|grep -i sql
Run Code Online (Sandbox Code Playgroud)

但是尝试通过以下方式执行时服务器没有启动:

$> mysql
Run Code Online (Sandbox Code Playgroud)

M 得到以下错误消息:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Run Code Online (Sandbox Code Playgroud)

我已经检查过,在/etc/init.d位置,只有mysql条目而不是mysqld,这是服务器启动错误的原因。

在谷歌搜索了几个小时,我也试过 ./mysql start from the same location 但得到以下输出:

Starting MySQL..The server quit without updating PID file (/var/lib/mysql/ABC2-rahul.pid).
Run Code Online (Sandbox Code Playgroud)

我是 mysql 的新手,任何帮助将不胜感激。提前致谢。


我查了一下,发现有些配置文件已经在/usr/share/mysql loaction里了,我把my-huge.cnf文件复制到了/etc位置,有什么意见吗?

以下是来自同一个 my.cnf 文件的内容:

[mysqld]
port            = 3306
socket          = /var/lib/mysql/mysql.sock
skip-external-locking
key_buffer_size = 384M
max_allowed_packet = 1M
table_open_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M

thread_concurrency = 8

log-bin=mysql-bin

server-id       = 1

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash

[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout
Run Code Online (Sandbox Code Playgroud)

ter*_*don 5

你试过启动mysql服务吗?以 root 身份运行:

service mysql start
Run Code Online (Sandbox Code Playgroud)

或者

/etc/init.d/mysql start 
Run Code Online (Sandbox Code Playgroud)

如果它仍然不起作用,请尝试以下方法之一。所有这些命令都应该以 root 身份运行:

这里的解决方案也可能有帮助。