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目录



你可能感兴趣的:(mysql)