应用系统切换到mysql应注意的_MySQL
bitsCN.com
mysql数据库简单,易用,现在越来越多的小的应用系统选择mysql数据库,也更因为mysql是免费的,不用付费。
mysql安装:以for window的为例:
将安装文件展开,执行安装:
展开mysql-5.1.6-alpha-win32(utf-8).zip后执行install.bat
安装完成后,在windows,控制面板,服务中,启动mysql的服务。
再安装mysql的客户端,类似plsqldev,但比plsqldev还是差很多。
用SQLyog604.exe这个客户端;
Navicat_for_MySQL_10.0.5.0_XiaZaiBa.exe这个记录的导入导出汉字会有问题。
然后将应用系统的表结构的建表sql转换成mysql的,常见常用的那些字段类型都支持
以eworkflow自定义工作流系统+eform自定义表单系统为例
表结构的转换:用sqlserver的表结构,转换到mysql
int,char,varchar,datetime等均不用变化
唯有ntext 需要转换成longtext类型
转换完的建表sql如下面格式:
表主键的定义语法,和其它的有些区别.
转换完成的表结构,在mysql中建立库,执行。
当应用系统作为产品来开发的时候,在设计之初就应该考虑好对多种数据源的支持。使得切换数据库的成本最低,甚至达到,会管理和使用一种数据库了,切换的工作也就完成了。
在eworkflow工作流+eform表单中,都预留好了接口,数据库链接的配置文件fcconfig.xml文件中,配置好ds数据库链接,如
将mysql的驱动包copy到系统的相应目录中。
fcworkflow.xml中配置好mysql的实现factory类。对每种数据库都可以有自己的实现类,因为mysql都是标准的sql,特殊性很少,所以就用JDBCWorkflowFactory做为实现类。
日期的实现函数很多数据库都不一样,mysql的获取系统日期的函数为now(),注意要将此函数替换掉原来的。
fcuser.xml中配置用户系统的Provider实现类,使得key="mysql"的类型和fcconfig.xml文件中第一个ds的dbType设置的值一致。
配置做好后,就可以开始做测试运行了
摘自 webreport
bitsCN.com
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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Big data structure processing skills: Chunking: Break down the data set and process it in chunks to reduce memory consumption. Generator: Generate data items one by one without loading the entire data set, suitable for unlimited data sets. Streaming: Read files or query results line by line, suitable for large files or remote data. External storage: For very large data sets, store the data in a database or NoSQL.

Backing up and restoring a MySQL database in PHP can be achieved by following these steps: Back up the database: Use the mysqldump command to dump the database into a SQL file. Restore database: Use the mysql command to restore the database from SQL files.

MySQL query performance can be optimized by building indexes that reduce lookup time from linear complexity to logarithmic complexity. Use PreparedStatements to prevent SQL injection and improve query performance. Limit query results and reduce the amount of data processed by the server. Optimize join queries, including using appropriate join types, creating indexes, and considering using subqueries. Analyze queries to identify bottlenecks; use caching to reduce database load; optimize PHP code to minimize overhead.

How to insert data into MySQL table? Connect to the database: Use mysqli to establish a connection to the database. Prepare the SQL query: Write an INSERT statement to specify the columns and values to be inserted. Execute query: Use the query() method to execute the insertion query. If successful, a confirmation message will be output.

Creating a MySQL table using PHP requires the following steps: Connect to the database. Create the database if it does not exist. Select a database. Create table. Execute the query. Close the connection.

To use MySQL stored procedures in PHP: Use PDO or the MySQLi extension to connect to a MySQL database. Prepare the statement to call the stored procedure. Execute the stored procedure. Process the result set (if the stored procedure returns results). Close the database connection.

One of the major changes introduced in MySQL 8.4 (the latest LTS release as of 2024) is that the "MySQL Native Password" plugin is no longer enabled by default. Further, MySQL 9.0 removes this plugin completely. This change affects PHP and other app

Oracle database and MySQL are both databases based on the relational model, but Oracle is superior in terms of compatibility, scalability, data types and security; while MySQL focuses on speed and flexibility and is more suitable for small to medium-sized data sets. . ① Oracle provides a wide range of data types, ② provides advanced security features, ③ is suitable for enterprise-level applications; ① MySQL supports NoSQL data types, ② has fewer security measures, and ③ is suitable for small to medium-sized applications.
