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  可能是丢失库文件或库文件的链接文件丢失
[root@upday mysql]# mysql
mysql: error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No such file or directory
[root@upday 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

[root@upday 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

[root@upday 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
 



  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MySQL_错误代码以及出错信息对照: 0101 属于其他进程的专用标志。 0102 标志已经设置,无法关闭。 0103 无法再次设置该标志。 0104 中断时无法请求专用标志。 0105 此标志先前的所有权已终止。 0106 请将软盘插入驱动器 %1。 0107 后续软盘尚未插入,程序停止。 0108 磁盘正在使用或已由其他进程锁定。 0109 管道已经结束。 0110 系统无法打开指定的设备或文件。 0111 文件名太长。 0112 磁盘空间不足。 0113 没有其他可用的内部文件标识符。 0114 目标内部文件标识符不正确。 0117 该应用程序所运行的 IOCTL 调用不正确。 0118 校验写入的开关参数值不正确。 0119 系统不支持所请求的命令。 0120 该系统上不支持此功能。 0121 标记已超时。 0123 文件名、目录名或卷标语法错误。 0124 系统调用层不正确。 0125 磁盘没有卷标。 0126 找不到指定的模块。 0127 找不到指定的过程。 0128 没有要等候的子进程。 0129 模式下运行。 0130 试图使用操作(而非原始磁盘I/O)的已打开磁盘分区的文件句柄。 0131 试图将文件指针移至文件开头之前。 0132 无法在指定的设备或文件中设置文件指针。 0133 对于包含已连接驱动器的驱动器,不能使用 JOIN 或 SUBST 命令。 0134 试图在已经连接的驱动器上使用 JOIN 或 SUBST 命令。 0135 试图在已经替换的驱动器上使用 JOIN 或 SUBST 命令。 0136 系统试图删除尚未连接的驱动器的 JOIN。 0137 系统试图删除尚未替换的驱动器的替换项。 0138 系统试图将驱动器连接到已连接的驱动器下的目录。 ... ...
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值