Home  >  Article  >  Backend Development  >  ACCESS database to MySQL quick migration applet_PHP tutorial

ACCESS database to MySQL quick migration applet_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 17:00:37737browse

Recently, in order to migrate an information management system developed for the company from the previous development machine (Windows NT IIS4.0 Access) to a real Linux server (Apache1.3.12 PHP 4.03 MySQL 3.23.26), The content migration of dozens of tables in the database started to take some trouble for me. I also downloaded some MySqL client software or database management software from the Internet. The better-written software all has data migration functions, but other There are only two migration methods. One is to use the file introduction method. This method will cause errors when processing the same characters as the delimiters in the database. Especially when processing the Memo field in ACCESS, it is easy to make errors. In the end, the exported data is either too much or too little. The other function that supports ODBC direct import is stronger and can basically import the contents of each table without errors, but unfortunately, this can only be done if the fields of the table created in ACCESS are in English. For example, in ACCESS, the fields are Chinese names usually also have errors and cannot be imported successfully.
For this reason, I had to spend some time writing two small programs for migrating the contents of the ACCESS database to MySQL. After using them, the results were pretty good, so I wrote them here for everyone to try or judge.
First outline the usage method,
1. Create a "system DSN" in the ACCESS database;
2. Create corresponding empty tables in MySQL according to the names of the tables in the ACCESS database;
3. Run fdlist.php;
4. Run import.php;
5. Each time you run steps 3 and 4, you can migrate a table, and then modify the ACCESS source table name in fdlist.php and MySQL. Target table name, then run steps 3 and 4 until all tables are migrated,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~
The following is the fdlist.php source program
~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~




$dbconnection = @mysql_connect("yourmysqlserver", "mysqlaccount", "mysqlpassword")

or die ("can not connect to database server");

@mysql_select_db("yourdatabase")

or die("

No Database,

") ;
$odbc_table = "youroriginaltable" ; // The original table name in your ODBC database

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/631218.htmlTechArticleRecently, in order to develop an information management system for the company, I changed the development machine (Windows NT) from the previous trial run. IIS4.0 Access) to a real Linux server (Apache1...
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