我的环境:
原有一mysql5.0实例,现新安装一mysql5.1,并将新的5.1实例的数据路径放在另一目录。
mysql5.1的my.ini如下
(配置my.ini的参考资料:
http://dev.mysql.com/doc/refman/5.1/en/option-files.html
http://downloads.mysql.com/docs/mysql-windows-excerpt-5.1-en.pdf
http://dev.mysql.com/doc/refman/5.0/en/multiple-windows-servers.html
关键是几个属性:
client组、mysqld组的port要不同;
mysqld组的basedir指示mysql的安装目录;
mysqld组的datadir、innodb_data_home_dir前者是数据的目录,后者是innodb的数据目录,两者必须相同,否则会报错如下:
InnoDB: No valid checkpoint found.
InnoDB: If this error appears when you are creating an InnoDB database,
InnoDB: the problem may be that during an earlier attempt you managed
InnoDB: to create the InnoDB data files, but log file creation failed.
InnoDB: If that is the case, please refer to
InnoDB: http://dev.mysql.com/doc/refman/5.1/en/error-creating-innodb.html
100515 20:50:51 [ERROR] Plugin 'InnoDB' init function returned error.
100515 20:50:51 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
100515 20:50:52 [ERROR] Unknown/unsupported table type: INNODB
100515 20:50:52 [ERROR] Aborting;
)
#------------------------------------------------------------------------------------------------------------
# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup o