MySQL help... plz

Dare

Well-Known Member
Joined
Mar 15, 2006
Messages
158
Reaction score
0
Location
Somewhere Else
Hi guyz

I need some help from you programming guyz.

Ok here's my situation:

I have a number of websites that use the same website script, the script uses a mysql database.

What I would like to do is create another website that has all the data of these sites. It will use the same script.

So i need some how to amend all the MySQL data into the one MySQL DB.

I have found a script that exports all your mysql data into a file then uplaod with FTP to location of ur choice.

So now that I have these files how do I amend those .sql files into the single DB?:confused:

thanks very much for help!!
 
If I understand you correctly...
You want to put all of the data into one database. Once you have a .sql file, containing the exported data from all of your databases, go into phpmyadmin (do you have it?) and select the database that you want to add the data to, then click the import button (found in the middle frame, near the top), browse to the location of your .sql files on your hdd, and start importing :)

Shout if you need more help.
Cheers, Nick
 
that sounds to easy..

will that append all the data from the .sql file into the DB and not replace the existing data?

Also i would like to create a cron job to run this importing processes.. any help with that?

thanks very much for help!!!
 
Ok, i found a solution.

I can import those sql files into my DB, but the problem comes in where the primary key will be the same in each of the other DB's.

So what I need to do is change there primary keys to a different range.
example: start at 1000000 then the next Db start at 2000000,

yes this will be a temporary solution..
 
If you want to do it manually, (you probably wont since you want to use a cron job) I would suggest using Navicat, very nice MySQL tool.
Another solution would be to connect all the sites to one database, then there's no need to import.
 
If you want to do it manually, (you probably wont since you want to use a cron job) I would suggest using Navicat, very nice MySQL tool.
Another solution would be to connect all the sites to one database, then there's no need to import.

the thing is I dont want the other sites to have each others data. ;)

navicat looks very cool, but i need it done automatically..
 
Top
Sign up to the MyBroadband newsletter
X