centos yum安装mysql出现的错误与解决办法

(1)“InnoDB Error ib_logfile0 of different size”错误的解决方法
查看Mysqld(/var/log/mysqld.log)日志,发现以下错误:
InnoDB: Error: log file /usr/local/mysql/data/ib_logfile0 is of different size 0
5242880 bytes
InnoDB: than specified in the .cnf file 0 104857600 bytes!
030826 1:42:15 Can't init databases
030826 1:42:15 Aborting

解决办法
"
If you want to change the number or the size of your InnoDB log files, you
have to shut down MySQL and make sure that it shuts down without errors.
Then copy the old log files into a safe place just in case something went
wrong in the shutdown and you will need them to recover the database. Delete
then the old log files from the log file directory, edit my.cnf, and start
MySQL again. InnoDB will tell you at the startup that it is creating new log
files.
"

在你修改my.cnf的innodb_log_file_size参数前,请先停止mysql服务程序的运行(mysql的停止没有出现任何错误),并把 /var/lib/mysql目录下的ib_logfile0、ib_logfile1、ib_logfile2等之类的文件移除到一个安全的地方(旧日志文件的保留是为了防止意外的出现),以便Mysql重启后可以将新的ib_logfile0之类日志文件生成到/var/lib/mysql目录下。如果没有什么意外,旧的日志文件可以删除。



(2)Fatal error: Can’t open and lock privilege tables: Table ‘mysql.host’ doesn’t exist 的解决方法
原因是重装的时候数据目录不一致导致
最终解决方法如下:
在mysql的安装目录下,我的是/usr/local/mysql
./scripts/mysql_install_db   --usrer=mysql  --datadir=/usr/local/mysql/data/
然后再次启动,OK

(3)初始化数据库报错

报错现象:

root@mysql mysql-6.0.11-alpha]# scripts/mysql_install_db --basedir=/usr/local/mysql/ --user=mysql

Installing MySQL system tables...

ERROR: 1136  Column count doesn't match value count at row 1

150414  7:15:56 [ERROR] Aborting

150414  7:15:56 [Warning] Forcing shutdown of 1 plugins

150414  7:15:56 [Note] /usr/local/mysql//libexec/mysqld: Shutdown complete

Installation of system tables failed!  Examine the logs in

/var/lib/mysql for more information.

You can try to start the mysqld daemon with:

shell> /usr/local/mysql//libexec/mysqld --skip-grant &

and use the command line tool /usr/local/mysql//bin/mysql

to connect to the mysql database and look at the grant tables:

shell> /usr/local/mysql//bin/mysql -u root mysql

mysql> show tables

Try 'mysqld --help' if you have problems with paths.  Using --log

gives you a log in /var/lib/mysql that may be helpful.

The latest information about MySQL is available on the web at

http://www.mysql.com/.  Please consult the MySQL manual section

'Problems running mysql_install_db', and the manual section that

describes problems on your OS.  Another information source are the

MySQL email archives available at http://lists.mysql.com/.

Please check all of the above before mailing us!  And remember, if

you do mail us, you MUST use the /usr/local/mysql//scripts/mysqlbug script!

原因:

原有安装的mysql信息没有删除干净

解决方法:

删除/var/lib/mysql目录



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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值