简体   繁体   English

Mysql无法启动

[英]Mysql failed to start

I have installed mysql-5.6.14 from source pack 我从源包安装了mysql-5.6.14

trying to start: 试图开始:

vaio1@vaio1-VPCEA3S1E:mysqld 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

Open the terminal and run this command for starting mysql service: 打开终端并运行此命令以启动mysql服务:

$ sudo mysqld_safe --skip-grant-tables

while mysql service is running, then open other terminal and run: 当mysql服务正在运行时,然后打开其他终端并运行:

$ sudo mysql_upgrade -u root -p
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

Maybe, you got the MySQL 5.6 binary but my.cnf and data file is older version. 也许,你有MySQL 5.6二进制文件,但my.cnf和数据文件是旧版本。

have you read MySQL upgrade Manual ? 你读过MySQL升级手册吗?

main reason MySQL has dead is : 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

see Manual how to use mysql_upgrade. 请参阅手册如何使用mysql_upgrade。 most of error message is related to deprecated options . 大多数错误消息与已弃用的选项有关

I have compiled from the sourceforge zip : mysql-5.6.14 我从sourceforge zip编译: mysql-5.6.14

Trying to mysql_upgrade: 尝试mysql_upgrade:

vaio1@vaio1-VPCEA3S1E:~/Téléchargements/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 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)

I don't understand why 我不明白为什么

 user                              (No default value)

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

 user = mysql

vaio1@vaio1-VPCEA3S1E:~/Téléchargements/mysql-5.6.14$ mysqld_safe --skip-grant-tables 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 --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

Trying this: sudo chown -R mysql /var/lib/mysql also .. chown..var/log/mysql/ 试试这个:sudo chown -R mysql / var / lib / mysql也.. chown..var / log / mysql /

 .. change nothing

YES! 是! maybe problem from default user; 可能是默认用户的问题;

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

Trying mysqld 尝试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 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys' 2013-11-18 11:36:36 24679 [错误]找不到消息文件'/usr/share/mysql/errmsg.sys'

Coping 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 解析/usr/share/mysql/errmsg.sys

Whatever the list of MySQL "ini" files are present in : "MySQL\\MySQL Server 5.2\\" folder, replace them from your frined. 无论MySQL“ini”文件列表中是否存在以下内容:“MySQL \\ MySQL Server 5.2 \\”文件夹,请将其替换为您的文件。 I wasted so much time and still dont know the root cause of the problem. 我浪费了太多时间,仍然不知道问题的根本原因。 Do check ".err" file present in "data" folder for errors if any. 检查“data”文件夹中的“.err”文件是否存在错误(如果有)。 Now start the service & Done. 现在开始服务和完成。 Its just makes entry somewhere & u try to debug for the problem soluton, instead this was faster approach. 它只是让你进入某个地方并尝试调试问题解决方案,而这是更快的方法。

Just ran into the same issue as mentioned in this question and tried lot of solutions, at last I figured out what was wrong. 刚刚遇到了这个问题中提到的相同问题并尝试了很多解决方案,最后我发现了什么是错的。 The issue came with the server upgrading. 问题出在服务器升级上。 Files from mysql-libs-5.1.73-5.el6_6.x86_64 replaced those in MySQL-server-5.6.15-1.el6.x86_64, so after reinstalling, the server comes back. mysql-libs-5.1.73-5.el6_6.x86_64中的文件替换了MySQL-server-5.6.15-1.el6.x86_64中的文件,因此重新安装后,服务器会回来。 Here is what I did for a furture reference. 这是我为进一步参考所做的。

$ 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-*

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM