Mysql无法启动

时间:2013-11-17 12:38:19

标签: daemon mysql

我已从源包

安装了mysql-5.6.14

试图开始:

  

vaio1 @ vaio1-VPCEA3S1E:mysqld的

 2013-11-17 13:22:18 0 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
 2013-11-17 13:22:18 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
 2013-11-17 13:22:18 1777 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
 2013-11-17 13:22:18 1777 [Warning] One can only use the --user switch if running as root  
 2013-11-17 13:22:18 1777 [Warning] Buffered warning: Changed limits: max_open_files: 1024 (requested 5000)
 2013-11-17 13:22:18 1777 [Warning] Buffered warning: Changed limits: table_cache: 431 (requested 2000)
 2013-11-17 13:22:18 1777 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
 2013-11-17 13:22:18 1777 [Note] Plugin 'FEDERATED' is disabled.mysqld: Unknown error 1146
 2013-11-17 13:22:18 1777 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
 2013-11-17 13:22:18 1777 [Note] InnoDB: The InnoDB memory heap is disabled
 2013-11-17 13:22:18 1777 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
 2013-11-17 13:22:18 1777 [Note] InnoDB: Compressed tables use zlib 1.2.3
 2013-11-17 13:22:18 1777 [Note] InnoDB: Using CPU crc32 instructions
 2013-11-17 13:22:18 1777 [Note] InnoDB: Initializing buffer pool, size = 128.0M
 2013-11-17 13:22:18 1777 [Note] InnoDB: Completed initialization of buffer pool
 2013-11-17 13:22:18 1777 [Note] InnoDB: Highest supported file format is Barracuda.
 2013-11-17 13:22:19 1777 [Note] InnoDB: 128 rollback segment(s) are active.
 2013-11-17 13:22:19 1777 [Note] InnoDB: Waiting for purge to start
 2013-11-17 13:22:19 1777 [Note] InnoDB: 5.6.14 started; log sequence number 1600677
 2013-11-17 13:22:19 1777 [ERROR] Aborting

6 个答案:

答案 0 :(得分:10)

打开终端并运行此命令以启动mysql服务:

$ sudo mysqld_safe --skip-grant-tables

当mysql服务正在运行时,然后打开其他终端并运行:

$ sudo mysql_upgrade -u root -p

答案 1 :(得分:3)

mysqld reads this standard configuration file and can not read the 5.5 message file in
5.6, leading to this error.

Solutions :

1. pass your configuration file to mysql_install_db

./scripts/mysql_install_db --defaults-file=my.cnf

2. use --no-defaults, not to read other configuration files

./scripts/mysql_install_db --no-defaults --basedir=/home/praveen/mysql-5.6.10-linux-x86_65 
--datadir=/home/praveen/data

答案 2 :(得分:2)

也许,你有MySQL 5.6二进制文件,但my.cnf和数据文件是旧版本。

你读过MySQL upgrade Manual吗?

MySQL已经死亡的主要原因是:

Unknown error 1146 2013-11-17 13:22:18 1777 [ERROR] Can't open the mysql.plugin table.
Please run mysql_upgrade to create it

参见Manual如何使用mysql_upgrade。大多数错误消息与已弃用的选项相关。

答案 3 :(得分:0)

  

我是从sourceforge zip编译的:mysql-5.6.14

     

尝试使用mysql_upgrade:

     

vaio1 @ vaio1-VPCEA3S1E:〜/Téléchargements/ mysql-5.6.14 $ mysql_upgrade

  Looking for 'mysql' as: mysql
  Looking for 'mysqlcheck' as: mysqlcheck
  FATAL ERROR: Upgrade failed
  

vaio1 @ vaio1-VPCEA3S1E:〜/Téléchargements/ mysql-5.6.14 $ mysqlcheck

  Variables (--variable-name=value)
  and boolean options {FALSE|TRUE}  Value (after reading options)
  --------------------------------- ----------------------------------------
  all-databases                     FALSE
  all-in-1                          FALSE
  auto-repair                       FALSE
  bind-address                      (No default value)
  character-sets-dir                (No default value)
  compress                          FALSE
  databases                         FALSE
  debug-check                       FALSE
  debug-info                        FALSE
  default-character-set             (No default value)
  default-auth                      (No default value)
  fast                              FALSE
  fix-db-names                      FALSE
  fix-table-names                   FALSE
  force                             FALSE
  extended                          FALSE
  host                              (No default value)
  write-binlog                      TRUE
  plugin-dir                        (No default value)
  port                              0
  quick                             FALSE
  silent                            FALSE
  skip-database                     (No default value)
  socket                            (No default value)
  ssl                               FALSE
  ssl-ca                            (No default value)
  ssl-capath                        (No default value)
  ssl-cert                          (No default value)
  ssl-cipher                        (No default value)
  ssl-key                           (No default value)
  ssl-crl                           (No default value)
  ssl-crlpath                       (No default value)
  ssl-verify-server-cert            FALSE
  use-frm                           FALSE
  user                              (No default value)
  

我不明白为什么

 user                              (No default value)
  

在我的文件中:/etc/mysql/my.cnf

 user = mysql
  

vaio1 @ vaio1-VPCEA3S1E:〜/Téléchargements/ mysql-5.6.14 $ mysqld_safe --skip-grant-tables

 131118 10:10:04 mysqld_safe Logging to '/var/log/mysql/error.log'.
 touch: impossible de faire un touch «/var/log/mysql/error.log»: Permission non accordée
 chmod: impossible d'accéder à «/var/log/mysql/error.log»: Aucun fichier ou dossier de ce type ## No files or directory
 131118 10:10:04 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
 /usr/local/mysql/bin/mysqld_safe: 129: /usr/local/mysql/bin/mysqld_safe: cannot create /var/log/mysql/error.log: Permission denied
 /usr/local/mysql/bin/mysqld_safe: 1: eval: cannot create /var/log/mysql/error.log: Permission denied
 touch: impossible de faire un touch «/var/log/mysql/error.log»: Permission non accordée
 chown: impossible d'accéder à «/var/log/mysql/error.log»: Aucun fichier ou dossier de ce type ## No files or directory
 chmod: impossible d'accéder à «/var/log/mysql/error.log»: Aucun fichier ou dossier de ce type 
 131118 10:10:04 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
 /usr/local/mysql/bin/mysqld_safe: 129: /usr/local/mysql/bin/mysqld_safe: cannot create /var/log/mysql/error.log: Permission denied
  

... $ mysqlcheck --all-databases --check-upgrade --auto-repair

 mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
  

试试这个:sudo chown -R mysql / var / lib / mysql   还.. chown..var / log / mysql /

 .. change nothing
  

YES!可能是默认用户的问题;

 sudo cmod 777 var/log/mysql/  ## just test lol
  

尝试mysqld

 vaio1@vaio1-VPCEA3S1E:~/Téléchargements/mysql-5.6.14$ mysqld
 2013-11-18 11:36:36 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
 2013-11-18 11:36:36 24679 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
 2013-11-18 11:36:36 24679 [Warning] One can only use the --user switch if running as root
  

2013-11-18 11:36:36 24679 [错误]找不到消息文件'/usr/share/mysql/errmsg.sys'

     

应对errmsg.sys

 sudo cp /usr/local/mysql/share/english/errmsg.sys /usr/share/errmsg.sys
 sudo chown mysql /usr/share/errmsg.sys

Resolve /usr/share/mysql/errmsg.sys

答案 4 :(得分:0)

无论MySQL“ini”文件列表中是否存在以下内容:“MySQL \ MySQL Server 5.2 \”文件夹,请将其替换为您的文件。 我浪费了太多时间,仍然不知道问题的根本原因。 检查“data”文件夹中的“.err”文件是否存在错误(如果有)。 现在开始服务&完成。 它只是进入某个地方&你尝试调试问题解决方案,而这是更快的方法。

答案 5 :(得分:0)

刚刚遇到了这个问题中提到的同样的问题并尝试了很多解决方案,最后我发现了什么是错的。问题出在服务器升级上。 mysql-libs-5.1.73-5.el6_6.x86_64中的文件替换了MySQL-server-5.6.15-1.el6.x86_64中的文件,因此重新安装后,服务器会回来。以下是我为进一步参考所做的工作。

$ rpm -qf /usr/share/mysql/english/errmsg.sys
MySQL-server-5.6.15-1.el6.x86_64
mysql-libs-5.1.73-5.el6_6.x86_64
$ rpm -e mysql-libs-5.1.73-5.el6_6.x86_64
$ rpm -ivh --replacepkgs MySQL-*