mysql 错误集锦

1)、 解决MySQL数据库SQL Error:1030, SQLState: HY000,Got error 28 from storage engine
问题原因:MySQL数据库的存储数据文件的磁盘空间不够,或者MySQL使用的临时目录文件的磁盘空间不够。
2)、
报错1:
     demo:/usr/local/mysql# mysql
          -bash: mysql: command not found
报错2:
demo:/root/sbin# mysqladmin -uroot password '1234567'
-bash: mysqladmin: command not found
报错3:
demo:/root/sbin# /usr/local/mysql/bin/mysql_secure_installation
Can't find a 'mysql' client in PATH or ./bin
Cleaning up...
Warning: Could not unlink .my.cnf.23079: No such file or directory
Warning: Could not unlink .mysql.23079: No such file or directory

解决方法:没有加入环境变量
echo "export PATH=$PATH:/usr/local/mysql/bin/" >> /root/.bash_profile
source /root/.bash_profile

3)、
运行: [root@localhost mysql]# scripts/mysql_install_db
报错:Neither host 'localhost.localdomain' nor 'localhost' could be looked up with
/resolveip
Please configure the 'hostname' command to return a correct  hostname.
If you want to solve this at a later stage, restart this script with the --force option
这个主要是修改/etc/hosts文件
echo "127.0.0.1 localhost.localdomain localhost" >> /etc/hosts
然后再初始化数据,如果还是同样的错误,那就直接加--force开关。

另一种可能就是版本的问题,先看看自己系统是什么版本的 uname -a  64位还是 32位

4)、
启动mysql报错:Starting MySQL...The server quit without updating PID file (/data01/mysql/demo.pid).[FAILED]
查看 mysql 是否已经启动 若没有则 rm -rf  /data01/mysql/demo.pid,然后再启动,继续报错,查看是否有 mysql 进程,然后 killall -9 mysqld

5)、
安装 mysql 报错:Manager of pid-file quit without updati
解决:安装的时候还有 mysql 进程还在运行着, kill 掉那些进程就可以了

6)、启动从的时候:
报错:[ERROR] Slave SQL: Slave failed to initialize relay log info structure from the repository, Error_code: 1872

解决:

1.在my.cnf中添加
relay_log=/db/mysql56/logs/relay_98_3326

2. reset slave
mysql>reset slave

mysql>change master to
master_host='192.168.32.79',
master_user='repl',
master_password='1234567',
master_port=3306,
master_log_file='mysql-bin.001229',
master_log_pos=15970007;

mysql>start slave;


7)mysql dump 的时候 
报错:mysqldump:got error 28 on write
解决: This is sometimes caused when the specified mysql dump folder isn't given enough permissions. Instead change the dump path to something contained inside the user's home folder

8)数据库突然崩掉了,启动的时候
错误:
Plugin 'FEDERATED' is disabled.
/usr/local/mysql/bin/mysqld: File '/data01/mysqllog/binlog/mysql-bin.000005' not found (Errcode: 2 - No such file or directory)
并且zabbix 监控报错: Lack of available memory on server zjtest2-pay
原因:数据很久没用了, binlog 又被删除了,然后一直写不进去, 挂掉了。binlog日志只有在重启的时候或者 binlog 文件满的时候会重新创建一个。
解决:删除所有的 binlog 下的文件,主要是 binlog.index 文件,重新开始  binlog 文件的创建

9)、mysql导入数据的时候
解决: ulimit -a 查看系统文件参数; ulimit -n 65535; ulimit -u 65535
修改配置文件,重启有效:
如何设置普通用户的ulimit值
1、vim /etc/profile
增加 ulimit -n 10240
source /etc/profile 重新启动就不需要运行这个命令了。
2、修改/etc/security/limits.conf
增加
*      hard     nofile    65535
\\限制打开文件数10240
3、测试,新建普通用户,切换到普通用户使用ulit -a 查看是否修改成功。

soft  nofile  65535 
hard  nofile  65535 

soft  nproc  65535 
hard  nproc  65535 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值