利旧原来安装的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
相关文档:
稳故而知新,最近又用到了,草草拿来温习一下:转自 http://www.bccn.net/Article/sjk/mysql/jc/200601/3411.html
MySQL管理员应该知道如何设置MySQL用户账号,指出哪个用户可以连接服务器,从哪里连接,连接后能做什么。MySQL
3.22.11开始引入两条语句使得这项工作更容易做:GRANT语句创建MySQL用户并指定其权限,而REV ......
1016错误:文件无法打开,使用后台修复或者使用phpmyadmin进行修复。
1044错误:数据库用户权限不足,请联系空间商解决
1045错误:数据库服务器/数据库用户名/数据库名/数据库密码错误,请联系空间商检查帐户。
1054错误:程序文件跟数据库有冲突,请使用正确的程序文件上传上去覆盖。
1146错误:数据表缺失,请恢 ......
备份MySQL数据库的命令
mysqldump -hhostname -uusername -ppassword databasename > backupfile.sql
备份MySQL数据库为带删除表的格式
备份MySQL数据库为带删除表的格式,能够让该备份覆盖已有数据库而不需要手动删除原有数据库。
mysqldump -–add-drop-table -uusername -ppassword databasename > backu ......
如何导入.sql文件到mysql中?
C:\mysql\bin>mysql -u 用户名 -p 数据库名 < c:/test.sql (source "c:\adsense.sql" )
中间的空格是一个空格位。
同时使用200多MB的sql文件。
例如:
C:\Program Files\MySQL\bin>mysql -u root -p myrosz & ......