How to backup a Mysql database?

liunx

Guest
Please help!

I have developed a simple application on my home PC that uses PHP and a Mysql database. I am now trying to figure out how to get this to the web.

My problem is the MySql database, I have got in touch with the server support and they have said if I get back to them with the database backed up and saved with .sql extension then they will set it up for me.

The problem is, I don't have the foggiest, inklings of a clue as to what they are talking about.

In case you were wondering this is the first time I have done anything like this and would really appreciate some straight forward help on this.

Regards

Ian:rolleyes:At the mysql prompt:mysql> mysqldump dbname > yourFile.sqlI have a host that allows only one database. When I asked them to set up 4 database names they responded that only 1 is allowed per site. I'm looking for a host that will allow as many databases as I want.

Unless you're transferring a whole database all you need to have set up is the database name, password, and username.Torrent,

Thanks for the advice, unfortunately it doesn't work. I am typing :

mysqldump Messing > messing.sql

after the mysql> prompt but am getting no joy. I have tried this with semi-colon, tried inserting a valid path instead of just a filename but nothing seems to work. Any idea what I'm doing wrong?

microwebber,

I don't know if they'll let you have more than one database but send them an e-mail and ask support:

<!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->

I hope this helps.

Regards

IanDoh! Sorry, my mistake. It's not from the mysql prompt. It's from the mysql/bin folder. It's an .exe command.

c:\mysql\bin\mysqldump dbname > file.sql

You may have to specify login options but try it without first:

mysqldump -uUsername -pPassword dbname > file.sqlRighto, Tried that.

Unfortunately still having problems. The path to mysqldump.exe is as follows:

c:\Program Files\Apache Group\bin\mysqldump.exe

I tried the following command

c:\Program Files\Apache Group\bin\mysqldump [dbname] > MyFile.sql

I was then informed that \P, \A \b and \m were all invalid commands.

What am I doing wrong? I appreciate your patience.

Regards

IanAre you sure you are using the mysqldump.exe file? Did you move it from the mysql bin folder?

I just tried my above command on my home server and it worked perfectly. Not sure where those error messages are originating from. Failing this you might want to do a search for phpMyAdmin and Download and install the software. This provides a GUI'ish interface for these sort of operations (although I don't really like the interface much myself).Hi Ian,
in my opinion, you should definitely go for phpMyAdmin (find it on <!-- m --><a class="postlink" href="http://www.phpmyadmin.net">http://www.phpmyadmin.net</a><!-- m -->). You Download it, install it, and then type in the url to it in the browser.

Select the database in question, the table in question and then the "Export" tab. If you then select to save structure AND data, the content can be loaded into the database on the server - and within a matter of seconds you have the tables AND the content created on the server.

This is the principle I use whenever building a new site, at it is very handy.

All the best - and don't hesitate to return if you have further questions.

PerOriginally posted by microwebber
I have a host that allows only one database. When I asked them to set up 4 database names they responded that only 1 is allowed per site. I'm looking for a host that will allow as many databases as I want.

Unless you're transferring a whole database all you need to have set up is the database name, password, and username.
and you won't find any. just add another table as you can have many tables. I have seen over 100 tables on 1 database name.Wasn't microwebber referring to multiple databases, not tables? Anyway, neither microwebber's post or your answer help Globe with his question.

It would appear Globe simply wishes to back up a database he has, pass it to his host, and they will then reconstruct it for him.

I showed him the mysqldump command, which is quite a quick and easy way, but he had problems with that. Therefore I suggested he look at phpMyAdmin.huh? :) read it again.:p globe didn't have a question and micowebber had a question on multiple databases. that is why I said you won't find any, just add another table.

Orignally posted by ianprhead
c:\Program Files\Apache Group\bin\mysqldump [dbname] > MyFile.sql

you have mysql in the apache program??? there shouldn't be a mysqldump.exe in that folder.I made a mistake while installing MySql. This means i have, shall we say, a unique directory structure.

All seems to work though until this problem with backup.

Could this be my problem?I wouldn't doubt it. if you delete all the folders it made except the data folder and then installed it again and copy the data folder over I bet it would work. worth a shot anyway.
 
Top