search
Homephp教程php手册Access数据库导入Mysql的方法之一

Access数据库导入Mysql的方法之一

Jun 13, 2016 pm 12:40 PM
accessmysqldifferentcannotimportExportdatabasemethodof

不同数据库之间若不能导入导出,那么将是一件可怕的事情,所幸的是一般情况下通过不同的方法和途径,都可以实现,方法有多种,本人提供其中的一个,提供一个自己的处理思路,意在抛砖引玉,
    第一步:首先将access数据库利用自身的导出功能,自定义一种容易对其操作的格式的txt文本文档,这也是关系到下一步操作的关键。
    第二步:先在mysql中建立一个同样结构的表(当然,这步可以在第三步中用程序实现,由于时间仓促,我未能完成,抱歉)
    第三步:也就是自己编程了,想办法把导出的文件用程序把每条记录读出并写入到Mysql数据表当中,
    $row =  file("ipadress.txt"); //读出文件中内容到一个数组当中
    $num=count($row);//统计表中的记录总数
    mysql_connect("localhost","root","");//连接数据库
    mysql_select_db("cht");
  for ($i=0;$i   {
   $fields=explode(",",$row[$i]);
     //echo $fields[0];
     //echo $fields[1];
     //echo $fields[2];
   mysql_query("insert into ipaddress (area_h,area_f,address) values('$fields[0]','$fields[1]','$fields[2]')");
     }
    echo "导入成功!共有 $num 条记录导入,";
以上操作我是针对从网上下的一个ip地址对照表进行的操作,感兴趣的可以试一试, 

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

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

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MinGW - Minimalist GNU for Windows

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.

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools