Centos系统下载大全 | Redhat系统下载大全 | Windows2012系统下载大全 | Windows2008系统下载大全| CMS教程 | 网站地图 51运维网-专注Linux/Unix系统安全运维!
当前位置:51运维网 > 数据库 > Oracle > 正文

MySQL安装启动时报错一则

时间:2016-06-15 10:48 来源:网络整理 作者:51ou.com 阅读:

问题:

--成功安装
[root@hadoop0 rpm]# rpm -ivh MySQL-server-5.6.28-1.el6.x86_64.rpm
warning: MySQL-server-5.6.28-1.el6.x86_64.rpm: Header V3 DSA/SHA1 Signature, key ID 5072e1f5: NOKEY
Preparing...                ############################### [100%]
1:MySQL-server           ############################### [100%]


--但启动时报错
[root@hadoop0 rpm]# mysql -uroot
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@hadoop0 rpm]# service mysql start
Starting MySQL..... ERROR! The server quit without updating PID file (/var/lib/mysql/hadoop0.pid).

[root@hadoop0 mysql]# cd /var/lib/mysql/
[root@hadoop0 mysql]# vi hadoop0.err
2016-05-16 14:11:01 3839 [Note] InnoDB: 128 rollback segment(s) are active.
2016-05-16 14:11:01 3839 [Note] InnoDB: Waiting for purge to start
2016-05-16 14:11:01 3839 [Note] InnoDB: 5.6.28 started; log sequence number 1600607
2016-05-16 14:11:01 3839 [Note] Server hostname (bind-address): '*'; port: 3306
2016-05-16 14:11:01 3839 [Note] IPv6 is available.
2016-05-16 14:11:01 3839 [Note]   - '::' resolves to '::';
2016-05-16 14:11:01 3839 [Note] Server socket created on IP: '::'.
2016-05-16 14:11:01 3839 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist
160516 14:11:01 mysqld_safe mysqld from pid file /var/lib/mysql/hadoop0.pid ended


解决:初始化数据库
[root@hadoop0 ~]# mysql_install_db --user=mysql
Installing MySQL system tables...2016-05-16 14:22:45 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2016-05-16 14:22:45 0 [Note] /usr/sbin/mysqld (mysqld 5.6.28) starting as process 3906 ...
2016-05-16 14:22:45 3906 [Note] InnoDB: Using atomics to ref count buffer pool pages
2016-05-16 14:22:45 3906 [Note] InnoDB: The InnoDB memory heap is disabled
2016-05-16 14:22:45 3906 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2016-05-16 14:22:45 3906 [Note] InnoDB: Memory barrier is not used
2016-05-16 14:22:45 3906 [Note] InnoDB: Compressed tables use zlib 1.2.3
2016-05-16 14:22:45 3906 [Note] InnoDB: Using Linux native AIO
2016-05-16 14:22:45 3906 [Note] InnoDB: Using CPU crc32 instructions
2016-05-16 14:22:45 3906 [Note] InnoDB: Initializing buffer pool, size = 128.0M

2016-05-16 14:22:45 3906 [Note] InnoDB: Completed initialization of buffer pool

MySQL安装启动时报错一则


登录正常
[root@hadoop0 ~]# mysql -uroot
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.28 MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> exit
Bye


本文永久更新地址:

感谢您对【51运维网 http://www.51ou.com/】的支持,我们为您免费提供《MySQL安装启动时报错一则》技术文章,《MySQL安装启动时报错一则》详细使用和说明,有时《MySQL安装启动时报错一则》可能不完善、敬请谅解!如果《MySQL安装启动时报错一则》有错误请给我们留言,我们将尽快修复文章错误,如果您觉得本站不错,请分享给周围的朋友!谢谢!

顶一下
(0)
0%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
验证码:点击我更换图片