Mysql 启动失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20030741/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Mysql failed to start
提问by Amexi Logan
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
采纳答案by Jason Heo
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 Manualhow to use mysql_upgrade. most of error message is related to deprecated options.
请参阅手册如何使用 mysql_upgrade。大多数错误消息与不推荐使用的选项有关。
回答by Janderson Silva
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
回答by Praveen Kumar K R
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
回答by Amexi Logan
I have compiled from the sourceforge zip :mysql-5.6.14
Trying to mysql_upgrade:
vaio1@vaio1-VPCEA3S1E:~/Téléchargements/mysql-5.6.14$ mysql_upgrade
我从 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
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'
Coping errmsg.sys
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
回答by Saurabh M. Chande
Whatever the list of MySQL "ini" files are present in : "MySQL\MySQL Server 5.2\" folder, replace them from your frined. 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. Now start the service & Done. Its just makes entry somewhere & u try to debug for the problem soluton, instead this was faster approach.
无论MySQL“ini”文件列表存在于:“MySQL\MySQL Server 5.2\”文件夹中,从您的frined中替换它们。我浪费了这么多时间,仍然不知道问题的根本原因。如果有错误,请检查“data”文件夹中存在的“.err”文件是否有错误。现在启动服务并完成。它只是在某处进入并且您尝试调试问题解决方案,而不是这是更快的方法。
回答by caot
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. Here is what I did for a furture reference.
刚刚遇到了这个问题中提到的相同问题并尝试了很多解决方案,最后我找出了问题所在。问题来自服务器升级。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-*