Mysql服务器启动失败

Nic*_*ery 5 mysql debian

谷歌搜索了两个小时,我需要你的帮助。我在 Debian 虚拟机上并克隆了它。唯一的变化是它拥有的新 IP 地址。

Mysql 不再启动:

Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
Run Code Online (Sandbox Code Playgroud)

没有名为 mysql 的进程。/var/log 中的所有 mysql 日志文件都是空的。

这是 my.cnf 文件:

[client]
port        = 3306
socket      = /var/run/mysqld/mysqld.sock
[mysqld_safe]
socket      = /var/run/mysqld/mysqld.sock
nice        = 0

[mysqld]
user        = mysql
pid-file    = /var/run/mysqld/mysqld.pid
socket      = /var/run/mysqld/mysqld.sock
port        = 3306
basedir     = /usr
datadir     = /var/lib/mysql
tmpdir      = /tmp
language    = /usr/share/mysql/english
skip-external-locking
bind-address        = 127.0.0.1
key_buffer      = 16M
max_allowed_packet  = 16M
thread_stack        = 192K
thread_cache_size       = 8
myisam-recover         = BACKUP
query_cache_limit   = 1M
query_cache_size        = 16M
general_log_file        = /var/log/mysql/mysql.log
log_bin         = /var/log/mysql/mysql-bin.log
expire_logs_days    = 10
max_binlog_size         = 100M

[mysqldump]
quick
quote-names
max_allowed_packet  = 16M
[mysql]
[isamchk]
key_buffer      = 16M
[mysqld_safe]
syslog
Run Code Online (Sandbox Code Playgroud)

这是 ifconfig 的结果:

eth0      Link encap:Ethernet  HWaddr 00:0c:29:12:98:9a  
          inet adr:192.168.1.138  Bcast:192.168.1.255  Masque:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:754 errors:0 dropped:0 overruns:0 frame:0
          TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:1000 
          RX bytes:101177 (98.8 KiB)  TX bytes:17719 (17.3 KiB)

lo        Link encap:Boucle locale  
          inet adr:127.0.0.1  Masque:255.0.0.0
          adr inet6: ::1/128 Scope:Hôte
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 lg file transmission:0 
          RX bytes:560 (560.0 B)  TX bytes:560 (560.0 B)
Run Code Online (Sandbox Code Playgroud)

根据要求,这是:sudo -u mysql mysqld 的结果,这是结果:

root@debian:/home/nicolas/Bureau# sudo -u mysql mysqld
121004 14:26:57 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
121004 14:26:57 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
121004 14:26:57  InnoDB: Initializing buffer pool, size = 8.0M
121004 14:26:57  InnoDB: Completed initialization of buffer pool
121004 14:26:57  InnoDB: Started; log sequence number 0 70822697
121004 14:26:57 [Note] Recovering after a crash using /var/log/mysql/mysql-bin
121004 14:26:57 [Note] Starting crash recovery...
121004 14:26:57 [Note] Crash recovery finished.
121004 14:26:57 [ERROR] mysqld: Can't find file: './mysql/host.frm' (errno: 13)
121004 14:26:57 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
Run Code Online (Sandbox Code Playgroud)

小智 6

可能是权限/var/lib/mysql错误,或者数据库结构没有初始化。尝试手动运行mysql:

#sudo -u mysql mysqld
Run Code Online (Sandbox Code Playgroud)

您将在控制台上获得所有守护进程的输出。


Nic*_*ery 0

因为我不能,因为我重新安装了一个新的虚拟机,谢谢你的帮助,这是个好主意