MYSQL错误汇总

问题描述:启动MySQL提示: Another MySQL daemon already running with the same unix socket

解决方法:

启动或重启mysql不成功,提示:Another MySQL daemon already running with the same unix socket

出现此问题往往是上次mysql意外关闭造成的.最简便的解决方法就是找到mysql.sock文件删除掉,再重新启动mysqld即可成功.

查找

updatedb

locate mysql.sock

完全卸载MYSQL

01、检测MySQL存在与否

rpm -qa | grep mysql

2、关闭MySQL服务

ss -ln | grep 3306  #查看是否开启MySQL

/etc/init.d/mysqld stop   或  service mysqld stop

3、查看安装文件目录

卸载RPM

yum remove mysql mysql-server mysql-libs

find / -name mysql

rm -rf   xxx

04、删除mysql用户

userdel -r mysql

问题描述:缺少这个共享库 libmysqlclient.so.16  可能是丢失库文件或库文件的链接文件丢失

[[email protected] mysql]# mysql
mysql: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
[[email protected] mysql]# service mysqld start
/usr/bin/mysqladmin: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
Cannot check for MySQL Daemon startup because of mysqladmin failure.
Starting mysqld:                                           [FAILED]

解决方法:

yum remove mysql-libs   #卸载

yum install -y mysql-libs   #在安装

问题描述:丢失mysql.hosts文件

问题解决:

查看日志

cat /etc/my.cnf  #查看日志存放的位置

tail  /var/log/mysqld.log

[[email protected] mysql]# tail /var/log/mysqld.log
160912 10:54:29 [ERROR] Fatal error: Can‘t open and lock privilege tables: Table ‘mysql.host‘ doesn‘t exist
160912 10:54:29 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
160912 10:54:43 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
/usr/libexec/mysqld: Table ‘mysql.plugin‘ doesn‘t exist
160912 10:54:43 [ERROR] Can‘t open the mysql.plugin table. Please run mysql_upgrade to create it.
160912 10:54:43  InnoDB: Initializing buffer pool, size = 8.0M
160912 10:54:43  InnoDB: Completed initialization of buffer pool
160912 10:54:43  InnoDB: Started; log sequence number 0 44233
160912 10:54:43 [ERROR] Fatal error: Can‘t open and lock privilege tables: Table ‘mysql.host‘ doesn‘t exist
160912 10:54:43 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

从日志中看出需要初始化数据库

mysql_install_db

[[email protected] mysql]# mysql_install_db
Installing MySQL system tables...
OK
Filling help tables...
OK

To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system

PLEASE REMEMBER TO SET A PASSWORD FOR THE MySQL root USER !
To do so, start the server, then issue the following commands:

/usr/bin/mysqladmin -u root password ‘new-password‘
/usr/bin/mysqladmin -u root -h upday password ‘new-password‘

Alternatively you can run:
/usr/bin/mysql_secure_installation

which will also give you the option of removing the test
databases and anonymous user created by default.  This is
strongly recommended for production servers.

See the manual for more instructions.

You can start the MySQL daemon with:
cd /usr ; /usr/bin/mysqld_safe &

You can test the MySQL daemon with mysql-test-run.pl
cd /usr/mysql-test ; perl mysql-test-run.pl

Please report any problems with the /usr/bin/mysqlbug script!

设置MySQL密码
mysqladmin  -u root  password ‘123123‘

登录MySQL

mysql -u root -p

 曾经的回忆

引用

http://www.cnblogs.com/kerrycode/p/4364465.html

http://www.cnblogs.com/ayanmw/p/3434028.html
http://www.cnblogs.com/ylqmf/archive/2011/10/17/2215726.html




时间: 2024-10-09 22:31:51

MYSQL错误汇总的相关文章

mysql 错误汇总

mysql更改表字符集和排序方式的时候出现如下错误. (HY000): Error on rename of .... (errno: 150). 因为表中的外键或主键的问题. 需要修改FOREIGN_KEY_CHECKS=0的值为0.然后再更改该表的字符集和排序方式,然后再把该变量值改回为1.即可. 使用如下的命令更改即可. "use confluence;SET FOREIGN_KEY_CHECKS=0; alter table $i convert to character set utf

CentOS安装MySQL问题汇总

遇到的错误 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO) denied for user 'root'@'localhost' (using password: NO) 描述:刚安装完MySQL,第一次登陆. [[email protected] ~]$ mysql -u root -p Enter password: #我记得root初始是没密码的,这句直接回车 ERROR

MySQL复习汇总

以下引自燕十八老师的复习秘籍. 顺附燕十八老师的个人博客:伟大的农场主,兼职PHP讲师. mysql复习 一:复习前的准备 1:确认你已安装wamp 2:确认你已安装ecshop,并且ecshop的数据库名为shop 二 基础知识: 1.数据库的连接 mysql -u -p -h -u 用户名 -p 密码 -h host主机 2:库级知识 2.1 显示数据库: show databases; 2.2 选择数据库: use dbname; 2.3 创建数据库: create database db

Linux错误汇总

Linux错误汇总 一,Linux系统下安装完MySQL,启动MySQL报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with... [[email protected]ost ~]# mysql ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' 

MYSQL 错误 :Out of resources when opening file './datagather/mx_domain#P#p178.MYD' (Errcode: 24) 解决办法

出现Out of resources when opening file './xxx.MYD' (Errcode: 24)错误是因为打开的文件数超过了my.cnf的--open-files-limit. open-files-limit选项无法在mysql命令行 直接修改,必须在my.cnf中设定,最大值是65536. 重新启动mysqld, mysql> show variables like 'open%'; +------------------+-------+ | Variable_

MySQL 错误日志(Error Log)

同大多数关系型数据库一样,日志文件是MySQL数据库的重要组成部分.MySQL有几种不同的日志文件,通常包括错误日志文件,二进制日志,通用日志,慢查询日志,等等.这些日志可以帮助我们定义mysqld内部发生的事情,数据库性能故障,记录数据的变更历史,用户恢复数据库等等.本文主要描述错误日志文件. 1.MySQL日志文件系统的组成   a.错误日志:记录启动.运行或停止mysqld时出现的问题.   b.通用日志:记录建立的客户端连接和执行的语句.   c.更新日志:记录更改数据的语句.该日志在M

解决远程连接mysql错误1130

Mysql远程连接Mysql服务器的数据库,错误代码是1130,ERROR 1130: Host xxx.xxx.xxx.xxx  is not allowed to connect to this MySQL server  猜想是无法给远程连接的用户权限问题. 这样子操作mysql库,即可解决.  在本机登入mysql后,更改 "mysql" 数据库里的 "user" 表里的 "host" 项,从"localhost"改称

mysql错误:The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement解决方法

Mysql关系型数据库管理系统 MySQL是一个开放源码的小型关联式数据库管理系统,开发者为瑞典MySQL AB公司.MySQL被广泛地应用在Internet上的中小型网站中.由于其体积小.速度快.总体拥有成本低,尤其是开放源码这一特点,许多中小型网站为了降低网站总体拥有成本而选择了MySQL作为网站数据库. 本文为大家讲解的是mysql错误:The MySQL server is running with the --skip-grant-tables option so it cannot

关于MySQL错误 2005 - Unknown MySQL server host 'localhost' (0) 原因及解决方法

今天在外面开navicat for mysql的时候,怎么也连不上自己本机上的数据库,一直显示2005 - Unknown MySQL server host 'localhost' (0): 错误代码的意思即无法连接上主机localhost.可能是由于没有联网造成的:于是将连接属性里的 '主机名或IP地址' 改成127.0.0.1即回送地址后,就可以连接上了.上百度搜了下,navicat里的一些功能应该是要联网的,而localhost是需要DNS解析后才会是127.0.0.1的,所以才会导致这