在一电脑上安装多mysql实例
我的环境:
原有一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
相关文档:
转:http://home.mysql.cn/space-51084-do-blog-id-43.html
本文讨论 MySQL
的备份和恢复机制,以及如何维护数据表,包括最主要的两种表类型:MyISAM 和 Innodb,文中设计的 MySQL 版本为 5.0.22。
目前 MySQL
支持的免费备份工具有:mysqldump、mysqlhotcopy,还可以用 SQL 语法进行备份:BACKUP TABLE 或者 SELECT
......
mysql字符集设置和查询问题(转)
2010-04-14 11:33
MySQL的字符集支持(Character Set Support)有两个方面:
字符集(Character set)和排序方式(Collation)。
对于字符集的支持细化到四个层次:
服务器(server),数据库(database),数据表(table)和连接(connection) ......
先用root登陆mysql -u root -p
mysql>show databases;
mysql>use mysql;
update user set password=password('你想设置的密码')
where user='root'; ......
MySQL 字符串截取函数:left(), right(), substring(), substring_index()。还有 mid(), substr()。其中,mid(), substr() 等价于 substring() 函数,substring() 的功能非常强大和灵活。
1. 字符串截取:left(str, length)
mysql> select left('sqlstudy.com', 3);+-------------------------+| left('sqlstudy.com', 3) | ......