今日网站突然报错,mysql的故障
Access denied for user 'root'@'localhost' (using password: YES)
错误位置 FILE: /var/www/html/ThinkPHP/Lib/Core/Db.class.php LINE: 162
紧紧排查问题
# chkconfig --list | grep -i mysql mysqld 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
# ps -ef | grep mysql root 3876 3634 0 10:35 pts/0 00:00:00 grep mysql root 31579 1 0 09:36 ? 00:00:00 /bin/sh /usr/bin/mysqld_safe --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock --pid-file=/var/run/mysqld/mysqld.pid --basedir=/usr --user=mysql mysql 31822 31579 0 09:36 ? 00:00:00 /usr/libexec/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --user=mysql --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
# service mysqld status mysqld (pid 31822) 正在运行...
显示Mysql运行正常,可就是无法连接数据库,连论坛discuz也同时失去连接。
按照百度的一些网友给出的方案:修改vi /etc/my.cnf配置文件
实际结果:不行,改后无法启动mysql,
# /usr/bin/mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
[root@AY130331113032374e11 ~]# service mysqld start
MySQL Daemon failed to start.
启动 mysqld: [失败]
只好将配置文件又退回去。
再反复试密码:
# mysql -u root
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Anyway 都不行
最后的解决办法:修改MySQL 的 root 密码
因为不熟悉linux命令,只好反复摸索,摸索结果在下面红色字符解释。
如果忘记了 MySQL 的 root 密码,可以用以下方法重新设置:
# /etc/init.d/mysqld stop (这一步很关键,之前就是这里没有执行,所以各种通不过)
停止 mysqld:
# service mysqld status
mysqld 已停
[root@localhost bin]# service mysql stop 别处查的资料,这个命令执行不了
Shutting down MySQL
[root@***~]# 150416 12:22:49 mysqld_safe Logging to '/var/log/mysqld.log'.
150416 12:22:49 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
(此步骤,我只执行到这里,网站就已经恢复了)
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 22
Server version: 5.5.30-cll MySQL Community Server (GPL) by Atomicorp
Copyright (c) 2000, 2013, 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的故障的更多相关文章
- mysql启动报错 mysql InnoDB: Error: could not open single-table tablespace file
mysql启动不成功,报错 mysql InnoDB: Error: could not open single-table tablespace file innodb_force_recovery ...
- mysql 数据传输报错 MySQL server has gone away With statement:
利用navicat premium 拷贝数据库时,报错MySQL server has gone away With statement:, 造成这样的原因一般是sql操作的时间过长,或者是传送的数据 ...
- 【生产问题】-dbcc checkdb报错-数据页故障
更多操作参考:https://www.cnblogs.com/gered/p/9435282.html [生产问题]-dbcc checkdb报错-数据页故障 数据页故障,索引页故障 use db_t ...
- MySQL Insert数据量过大导致报错 MySQL server has gone away
接手了同事的项目,其中有一个功能是保存邮件模板(包含图片),同事之前的做法是把图片进行base64编码然后存在mysql数据库中(字段类型为mediumtext)然后保存三张图片(大概400k)的时候 ...
- MYSQL导入数据报错|MYSQL导入超大文件报错|MYSQL导入大数据库报错:2006 - MySQL server has gone away
导SQL数据库结构+数据时,如果数据是批量插入的话会报错:2006 - MySQL server has gone away. 解决办法:找到你的mysql目录下的my.ini配置文件(如果安装目录没 ...
- mysql 有没有参数都报错“mysql: unknown option”
报错: [root@XXXX tmp]# mysql -uroot -pmysql: unknown option '--You have new mail in /var/spool/mail/ro ...
- linux 报错Mysql.pid 文件不存在导致service Mysqld start 失败
Mysql.pid 文件不存在导致service Mysqld start 失败 1. 到提示报错的mysql.pid 不存在的目录下 使用 touch 命令创建mysql.pid文件. t ...
- ubuntu安装了mysql 但是编译报错 mysql.h: No such file or directory
在Ubuntu体系中,已经安装了mysql,即应用sudo apt-get install mysql-server mysql-client 但是用C编译mysql数据库时,报错fatal erro ...
- linux定时任务报错mysql: command not found
本人在用docker做镜像的时候,把定时任务打到镜像里,但是执行的时候发现错误日志总是报 sh: mysql: command not found ,然后开始解决问题 1)首先确认镜像有没有装mysq ...
随机推荐
- Exchanger, Changing data between concurrent tasks
The Java concurrency API provides a synchronization utility that allows the interchange of data betw ...
- 在线HTML编辑器 kindeditor-4.1.10 上传图片文件 应用指南
1.在ASPX页面中对应的head.body添加相应的红色部分 2.引用kindeditor-4.1.10中的litjosn.dll 3.在写入数据库时要替换相应的路径和IP 4.kindeditor ...
- ASP 生成带日期的随机数
<% Function getRnd() '**************************************** '返回值:如getRnd(),即输出2008082415534646 ...
- C#学习笔记12:枚举、结构、数组基础学习
枚举:public enum MyEnum { 值1, 值2, 值3 } Public enum Season { 春, 夏, 秋, 冬 } 枚举的作用:规范用户的输入,枚举可以转换为int类型,可以 ...
- 使用repeater控件显示列表替代treeview
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- 用Python进行语音信号处理
1.语音信号处理之时域分析-音高追踪及其Python实现 2.语音信号处理之时域分析-音高及其Python实现 参考: 1.NumPy
- OpenJudge/Poj 1723 SOLDIERS
1.链接地址: http://bailian.openjudge.cn/practice/1723/ http://poj.org/problem?id=1723 2.题目: 总时间限制: 1000m ...
- Kali-Linux之开启ssh服务
需求:通过putty软件ssh到Kali-Linux系统 问题:默认情况下,Kali系统的ssh服务并没有开启 操作方法: 1.编辑sshd_config文件 root@kali:~# vi /etc ...
- opensuse安装mysql-workbench
首先安装好mysqlserver,做本地测试其实不用安装mysqlclient. 到http://software.opensuse.org/package/mysql-workbench 下载相应版 ...
- linux下python导出sybase 数据库 表记录的方式
导出sybase 数据库 表记录的方式 1 执行启动sybase 数据库命令 code : dbeng7 gkdb 2 执行 连接sybase 数据库命令code : dbisql -c " ...