bitsCN.com
第一步――安装MySQL
到http://dev.mysql.com/downloads/ 下载这个服务器、MySQL GUI工具和MySQL ODBC驱动。你可以选择的服务器有:5.0, 5.1或6.0。然后安装它们。
安装过程中的注意事项:
你的防火墙应该设置为允许通过3306端口连接。
将MySQL作为一个服务来运行(可以选择命令行方式)。
MySQL安装默认username/login = root和server = localhost。
MySQL提供了对存储引擎/表类型的选择――主要是MySAM和InnoDb。后者看起来更像是Access,它具有事务和外键,所以这篇文章中我们使用这种方式。
具有用户和安全选项。不要忘了记录所有的密码。
还有要安装Bullzip Access to MySQL和Dreamcoder为之后使用。
第二步――将表从Access移到MySQL
使用Bullzip将后台数据表转移到MySQL,或打开你的数据库并通过ODBC将你的数据导出。
要注意的事项:
MySQL不能识别Access默认用于字段的函数(例如Date/Time字段中的Now()和Date()函数):它们可能被删除或者表被拒绝。推荐你在转移/导出之前删除它们。
Access的autonumber字段与MySQL的auto_increment字段不一致。Bullzip在转移时会进行转换,而ODBC则不会。
Access数据类型会转换为类似的MySQL数据类型。但是,在MySQL中范围更大,你可能希望之后再改变它们。
Access的“ole object”变成了MySQL中的“blob”。因为一个OLE服务器问题,我们将blobs改为longtext。
步骤三――改变MySQL表(字段)
打开Dreamcoder或MySQL管理器(一个GUI工具)。如果你熟悉SQL Server,那么把这些看作是Enterprise或SQL server management studio express界面。
连接到这个转移/导出的数据库。
按顺序打开每一个表并检查:
Autonumber字段是auto_increment。
每一个表有一个主键(一个或多个字段)(在Dreamcoder中,创建-新约束)。否则,你需要在连接的时候指定,不然所连接的表将不能更新。
字段默认是正确的。我们检查与前端数据登入默认值的一致性。
是否允许Null值。
数据类型是否如预期。
有一个时间戳字段,默认为current_time(一般是表中的最后一个字段)。
步骤四――建立你的MySQL备份系统
打开MySQL管理器并备份你的MySQL数据库。这将schema和数据保存到一个.sql文件。如果你想在另一个计算机上建立数据库,那么在那台机器上安装一个MySQL服务器,然后将这个.sql文件的一个拷贝恢复到这个新服务器上。
步骤五――从前端链到MySQL
打开你的Access前端。如果你已经链接到一个Access后台,那么你不能使用这个已被链接的表管理器来改到一个ODBC数据源。所以删除到Access后台的链接,并通过ODBC链接到MySQL后台。类似的,一旦链接到了ODBC数据源,那么这个已链接的表管理器就只提供ODBC数据源的选项。
在建立ODBC数据源时,在ODBC配置中――Advanced ――Flags1,勾上Return Matching Rows和Allow Big Results。
性能
到目前的观察:
使用一个MySQL后台的Access 97比使用相同后台的Access 2007明显快得多。
最初这个混合和列表记录源使用记录源查询构建器。由于某种原因,使用用户创建的查询来替代它们可以获得速度上的显著提高。
在现在的配置中,Access 2007比使用MySQL后台的要快一点。bitsCN.com

ACID attributes include atomicity, consistency, isolation and durability, and are the cornerstone of database design. 1. Atomicity ensures that the transaction is either completely successful or completely failed. 2. Consistency ensures that the database remains consistent before and after a transaction. 3. Isolation ensures that transactions do not interfere with each other. 4. Persistence ensures that data is permanently saved after transaction submission.

MySQL is not only a database management system (DBMS) but also closely related to programming languages. 1) As a DBMS, MySQL is used to store, organize and retrieve data, and optimizing indexes can improve query performance. 2) Combining SQL with programming languages, embedded in Python, using ORM tools such as SQLAlchemy can simplify operations. 3) Performance optimization includes indexing, querying, caching, library and table division and transaction management.

MySQL uses SQL commands to manage data. 1. Basic commands include SELECT, INSERT, UPDATE and DELETE. 2. Advanced usage involves JOIN, subquery and aggregate functions. 3. Common errors include syntax, logic and performance issues. 4. Optimization tips include using indexes, avoiding SELECT* and using LIMIT.

MySQL is an efficient relational database management system suitable for storing and managing data. Its advantages include high-performance queries, flexible transaction processing and rich data types. In practical applications, MySQL is often used in e-commerce platforms, social networks and content management systems, but attention should be paid to performance optimization, data security and scalability.

The relationship between SQL and MySQL is the relationship between standard languages and specific implementations. 1.SQL is a standard language used to manage and operate relational databases, allowing data addition, deletion, modification and query. 2.MySQL is a specific database management system that uses SQL as its operating language and provides efficient data storage and management.

InnoDB uses redologs and undologs to ensure data consistency and reliability. 1.redologs record data page modification to ensure crash recovery and transaction persistence. 2.undologs records the original data value and supports transaction rollback and MVCC.

Key metrics for EXPLAIN commands include type, key, rows, and Extra. 1) The type reflects the access type of the query. The higher the value, the higher the efficiency, such as const is better than ALL. 2) The key displays the index used, and NULL indicates no index. 3) rows estimates the number of scanned rows, affecting query performance. 4) Extra provides additional information, such as Usingfilesort prompts that it needs to be optimized.

Usingtemporary indicates that the need to create temporary tables in MySQL queries, which are commonly found in ORDERBY using DISTINCT, GROUPBY, or non-indexed columns. You can avoid the occurrence of indexes and rewrite queries and improve query performance. Specifically, when Usingtemporary appears in EXPLAIN output, it means that MySQL needs to create temporary tables to handle queries. This usually occurs when: 1) deduplication or grouping when using DISTINCT or GROUPBY; 2) sort when ORDERBY contains non-index columns; 3) use complex subquery or join operations. Optimization methods include: 1) ORDERBY and GROUPB


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

Zend Studio 13.0.1
Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Atom editor mac version download
The most popular open source editor