利旧原来安装的XAMPP,但使MySQL支持Transaction
一直使用Mysql,最近才了解到Mysql支持了Transaction。老了,跟不少潮流了。
那就把原来的应用改成Based On Transaction的吧。
将建表语句改成Engine=InnoDB,好像还是不行,没有想象中那么简单。
查一查,哦,发现XAMPP安装的Mysql还要修改conf文件:
XAMPP from Apache Friends is a collection of free open source apps that make it easy to install Apache distribution containing MySQL, PHP and Perl. There are four XAMPP distributions for Windows, Linux , Mac OS X and Solaris. To set up an Apache web server with XAMPP, simply download and extract XAMPP, and the Apache HTTPD web server is ready after one or two more auto-execute scripts. There are no changes to the Windows registry (unless you’re using Widows installer version of XAMPP) and it’s not necessary to edit any configuration files.
However, by default, InnoDB MySQL database storage engine is not enabled in the my.cnf configuration file. If a webmaster plans to use InnoDB features, such as one to many or many to many table relationships on foreign key constraints, or transaction-safe commands such as commit, rollback and crash recovery capabilities.
To enable the support of MySQL server on InnoDB storage engine, locate the “my.cnf” config file (normally in /installation_path/xampp/mysql/bin/ directory), and edit the my.cnf with any text editor such as vi.
Search and locate each of the following lines (except the lines in italic where they’re comments):
- Comment the following line to unskip and use InnoDB
skip-innodb
- Uncomment the following options for InnoDB database if you are using InnoDB tables.
#innodb_data_home_dir = C:/xampp/xampp/mysql/data/
#innodb_data_file_path = ibdata1:10M:autoextend
#innodb_log_group_home_dir = C:/xampp/xampp/mysql/data/
#innodb_log_arch_dir = C:/xampp/xampp/mysql/data/
- Uncomment the lines and set innodb_buffer_pool_size up to 50% – 80% of RAM for optimization of InnoDB databases, try not to memory usage too high.
#set-variable = innodb
相关文档:
一次Nginx+PHP+Mysql的并发测试经历
一、硬件环境
CPU:4核Intel(R) Xeon(R) CPU E5504 @ 2.00GHz
6G内存,120G硬盘
二、软件环境
L ......
本文讨论 MySQL 的备份和恢复机制,以及如何维护数据表,包括最主要的两种表类型:MyISAM 和 Innodb,文中设计的 MySQL 版本为 5.0.22。
目前 MySQL 支持的免费备份工具有:mysqldump、mysqlhotcopy,还可以用 SQL 语法进行备份:BACKUP TABLE 或者 SELECT INTO OUTFILE,又或者备份二进制日志(binlog),还可以是 ......
最近使用root用户编写了几个存储过程,但是使用普通用户通过JDBC连接执行却报错:
java.lang.NullPointerException......
或
java.sql.SQLException: User does not have access to metadata required to determine stored procedure parameter types. If rights can not be granted, configure connection with " ......
网上的解决方法大多是要修改mysql配置文件,对我们不适合。jhost主页上看到篇文章,但里面说的驱动早就是老驱动了,怀疑他是从网上复制过来的老版本,不知是否能用。现在把我自己的解决方案贴出来,供大家参考,欢迎批评指正。
大家注意红色部分,废话不多说:
第一步:网页头设置:
<%@ page contentType="text/html ......