One of the methods for importing an Access database to Mysql. If you cannot import or export data between different databases, it is a terrible thing. Fortunately, different methods and methods can be used in various ways, if I cannot import or export data between different databases, it will be a terrible thing. Fortunately, different methods and methods can be used in a variety of ways, I provide one of them and provide my own solutions, which are intended to inspire others,
Step 1: First, the access database uses its own export function to customize a txt text document that is easy to operate on it, which is also the key to the next operation.
Step 2: first create a table with the same structure in mysql (of course, this step can be implemented using a program in step 3. I am sorry because of the rush of time)
Step 3: programming by yourself. you can use the program to read each record of the exported file and write it into the Mysql data table,
$ Row = file ("ipadress.txt"); // read the content of the file to an array.
$ Num = count ($ row); // The total number of records in the statistical table
Mysql_connect ("localhost", "root", ""); // connect to the database
Mysql_select_db ("cht ");
For ($ I = 0; $ I <$ num; $ I ++) // start the import record
{
$ 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 "imported successfully! A total of $ num records are imported ,";
The above operations are performed on an IP address table on the internet. if you are interested, try it,
...