几种常见MySQL无法启动案例
2013-10-20 22:10
776 查看
问题1:目录、文件权限设置不正确
MySQL的$datadir目录,及其下属目录、文件权限属性设置不正确,导致MySQL无法正常读写文件,无法启动。错误信息例如:
mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data /usr/local/mysql/bin/mysqld_safe: line 107: /usr/local/mysql/data/imysql.local.err: Permission denied
问题2:端口冲突
已有其他mysqld实例启动,且占用了相同端口,需要修改 port 选项。错误信息例如:
[ERROR] Can't start server: Bind on TCP/IP port: Address already in use [ERROR] Do you already have another mysqld server running on port: 3306 ? [ERROR] Aborting
问题3:innodb配置不正确
innodb中关于datafile、log file设置不正确,导致无法启动。尤其是第一次用默认参数启动过,后来又参考一些优化指南后,修改了innodb的参数,会提示different size,详细错误例如:InnoDB: Error: log file ./ib_logfile0 is of different size 0 5242880 bytes InnoDB: than specified in the .cnf file 0 134217728 bytes! [ERROR] Plugin ‘InnoDB’ init function returned error. [ERROR] Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed.
问题4:没有初始化mysql系统库
MySQL安装完后,需要运行mysql_install_db初始化mysql这个系统库,才能正常启动。本次先列举上述几个常见问题,下次再补充。
通常地,碰到mysqld进程无法启动时,不管任何错误,都优先检查错误日志(日志文件一般在 $datadir/xx.err文件,或者是 /var/log/message、/var/log/mysql/mysqld.log之类的),根据错误日志提示去找到问题原因,不要只看表面提示,例如找不到 mysql.sock 文件之类的。
相关文章推荐
- 每个MySQL开发者都应该了解的10个技巧
- 101个MySQL 的调节和优化的提示
- MYSQL-BINLOG
- MySQL性能优化的最佳20+条经验
- 利用mysql的binlog恢复数据
- MySQL概述
- mysql存储过程 动态SQL
- 金宫丁:对MySQL DBA的一些思考
- 安卓mysql的JDBC驱动
- mysql系统变量专题学习
- 我用mysql数据库添加一个字段为“text”类型时,却失败了?
- MySQL中文显示问题
- windows系统——mysql自动定时备份数据库的最佳方法
- 黄聪:wordpress向mysql字段中保存html代码(使用add_option()方法),然后无法显示出问题
- 初学mysql命令
- Mysql倒出数据错误:mysqldump Version Mismatch
- 使用XAMPP可视化管理Mysql,使用JDBC访问数据库执行插入、查询、删除等操作
- MAC mysql安装及设置
- mysql报错
- Can't connect to MySQL server on localhost (10061)解决方法