search
HomeDatabaseMysql Tutorial安装MySQL事务数据库(InnoDB)_MySQL

安装MySQL事务数据库(InnoDB)_MySQL

Jun 01, 2016 pm 02:06 PM
innodbmysqlaffairsdeal withInstalldatabaseTable of contents

InnoDBmysql安装

MySQL数据库分二种类型,一种是传统的数据表格式,一种是支持事务处理的数据表格式(InnoDB,BDB,其中以InnoDB为主),下面我介绍一下关于MySQL事务处理数据库的安装及使用方法
你先要去下载一下Mysql  max版的安装程序,下载地址:www.mysql.com
按常规的方法进行安装
安装完成后,启动mysqlbinWinMySQLadmin
再退出
运行
mysqlbinmydqld-nt  --remove
mysqlbinmysqld-max-nt  --install
以上二行是去掉不支持事务处理的mysql服务,改成支持mysql事务处理的服务
然后在c:下建一个ibdata目录及iblogs目录,当然名字可以不一样,记住这二个名字及盘符,以后要用到,你也可以不建在C盘,然后,打开c:winnt或c:windows目录下的my.ini,在最后添加:[code]
innodb_data_file_path  =  ibdata1:2000M;ibdata2:2000M
innodb_data_home_dir  =  c:ibdata
set-variable  =  innodb_mirrored_log_groups=1
innodb_log_group_home_dir  =  c:iblogs
set-variable  =  innodb_log_files_in_group=3
set-variable  =  innodb_log_file_size=30M
set-variable  =  innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1
innodb_log_arch_dir  =  c:iblogs
innodb_log_archive=0
set-variable  =  innodb_buffer_pool_size=80M
set-variable  =  innodb_additional_mem_pool_size=10M
set-variable  =  innodb_file_io_threads=4
set-variable  =  innodb_lock_wait_timeout=50
[/code]
其中
innodb_data_file_path  =  ibdata1:2000M;ibdata2:2000M
这一行中的2000M可以自己改成200m,看你盘的容量大小,mysql推荐10G及以上的硬盘空间最好用这样的设置;
以下这一行
innodb_data_home_dir  =  c:ibdata
也可以改成你自己起的目录,主要是看你自己在刚才建的目录在哪里啦
按照以上的方法,你已经安装好了mysql的事务数据库,不过你要是按照mysql手册上的方法安装,把上面的一段配制放到my.cnf是去的话,可是会出错哦
好了,现在让我们试试看是不是安装完成了,启动apache,或iis,在服务里启动mysql的服务,打开phpmyadmin,输入:SHOW  variables  like  "have_%" 
你要是看到下面的结果,那说明你安装成功了
[code]
Variable_name    Value   
have_bdb                    YES   
have_innodb          YES   
have_isam                  YES   
have_raid                      NO   
have_symlink          YES   
have_openssl          NO   
have_query_cache    YES   
[/code]
注:mysql的事务处理方法的使用同其它数据库语法相似,在这里我就不多说了,另外,Mysql将在4.3中实现外键及子查询,简单的外键已经在4.0中都已经实现了,只是不怎么方便,相信以后会做得更好些。
关于事务表的使用,我已经成功地在我的网上订单管理系统中实现,效果还不错,只是还没有经过大数据量的实践
以上文章是本人自己根据实践写出来的,如要转载,请注明出处及作者,也欢迎大家和我一起讨论关于Mysql事务表的一些问题

 

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What are the different storage engines available in MySQL?What are the different storage engines available in MySQL?Apr 26, 2025 am 12:27 AM

MySQLoffersvariousstorageengines,eachsuitedfordifferentusecases:1)InnoDBisidealforapplicationsneedingACIDcomplianceandhighconcurrency,supportingtransactionsandforeignkeys.2)MyISAMisbestforread-heavyworkloads,lackingtransactionsupport.3)Memoryengineis

What are some common security vulnerabilities in MySQL?What are some common security vulnerabilities in MySQL?Apr 26, 2025 am 12:27 AM

Common security vulnerabilities in MySQL include SQL injection, weak passwords, improper permission configuration, and unupdated software. 1. SQL injection can be prevented by using preprocessing statements. 2. Weak passwords can be avoided by forcibly using strong password strategies. 3. Improper permission configuration can be resolved through regular review and adjustment of user permissions. 4. Unupdated software can be patched by regularly checking and updating the MySQL version.

How can you identify slow queries in MySQL?How can you identify slow queries in MySQL?Apr 26, 2025 am 12:15 AM

Identifying slow queries in MySQL can be achieved by enabling slow query logs and setting thresholds. 1. Enable slow query logs and set thresholds. 2. View and analyze slow query log files, and use tools such as mysqldumpslow or pt-query-digest for in-depth analysis. 3. Optimizing slow queries can be achieved through index optimization, query rewriting and avoiding the use of SELECT*.

How can you monitor MySQL server health and performance?How can you monitor MySQL server health and performance?Apr 26, 2025 am 12:15 AM

To monitor the health and performance of MySQL servers, you should pay attention to system health, performance metrics and query execution. 1) Monitor system health: Use top, htop or SHOWGLOBALSTATUS commands to view CPU, memory, disk I/O and network activities. 2) Track performance indicators: monitor key indicators such as query number per second, average query time and cache hit rate. 3) Ensure query execution optimization: Enable slow query logs, record and optimize queries whose execution time exceeds the set threshold.

Compare and contrast MySQL and MariaDB.Compare and contrast MySQL and MariaDB.Apr 26, 2025 am 12:08 AM

The main difference between MySQL and MariaDB is performance, functionality and license: 1. MySQL is developed by Oracle, and MariaDB is its fork. 2. MariaDB may perform better in high load environments. 3.MariaDB provides more storage engines and functions. 4.MySQL adopts a dual license, and MariaDB is completely open source. The existing infrastructure, performance requirements, functional requirements and license costs should be taken into account when choosing.

How does MySQL's licensing compare to other database systems?How does MySQL's licensing compare to other database systems?Apr 25, 2025 am 12:26 AM

MySQL uses a GPL license. 1) The GPL license allows the free use, modification and distribution of MySQL, but the modified distribution must comply with GPL. 2) Commercial licenses can avoid public modifications and are suitable for commercial applications that require confidentiality.

When would you choose InnoDB over MyISAM, and vice versa?When would you choose InnoDB over MyISAM, and vice versa?Apr 25, 2025 am 12:22 AM

The situations when choosing InnoDB instead of MyISAM include: 1) transaction support, 2) high concurrency environment, 3) high data consistency; conversely, the situation when choosing MyISAM includes: 1) mainly read operations, 2) no transaction support is required. InnoDB is suitable for applications that require high data consistency and transaction processing, such as e-commerce platforms, while MyISAM is suitable for read-intensive and transaction-free applications such as blog systems.

Explain the purpose of foreign keys in MySQL.Explain the purpose of foreign keys in MySQL.Apr 25, 2025 am 12:17 AM

In MySQL, the function of foreign keys is to establish the relationship between tables and ensure the consistency and integrity of the data. Foreign keys maintain the effectiveness of data through reference integrity checks and cascading operations. Pay attention to performance optimization and avoid common errors when using them.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

SublimeText3 English version

SublimeText3 English version

Recommended: Win version, supports code prompts!

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.