Php/Mysql- uploading Mysql database

They have: 11 posts

Joined: Jul 2005

Hi,

OK, firstly let me state I am a total beginner to Mysql and databases (excluding basic Microsoft Access ones).

Anyway, I've set up a basic database using Mysql (just creating a web blog I followed a tutorial) and then started writing the php code for interacting with the database. how do I put the Mysql database onto the the web server where I have server space (the server I use is just some company that I pay €100 a year for). I need the php file to get the data from the Mysql database.

As I said before, I am a total beginner so please excuse my ignorance! I still havn't got my head around the Mysql concept!

Cheers

Greg K's picture

He has: 2,145 posts

Joined: Nov 2003

If you are using something like phpMyAdmin, there is a feature in there to EXPORT your data, including code to create databases/tables as needed before inserting code.

First thing, contact your hosting company, they may have to set up the database for you to use.

Where we have our hosting, they limit how many databases you can have on shared servers, and through their control panel you set up additional databases up to how many you can have for your plan level. If you setup is like this, you will want to export jus the tables and the data, as they will (or their control panel system will) set up the actual database, then you run the script from the export to rebuild all the tables/data.

Which tutorial are you using to do this? (can you poist a link) Just remember, there are tons of tutorials out there, and not all of them are the best/most secure method. It is usually just that the person who wrote the tutorial doesn't know, not that they purposely are giving bad examples. There are many ways to program, but not all cover security issues.

I had run into this when it came to designing a user conrol system, tons of "register/login" scripts, not all of them really good. I compared about 20-25 of them and pulled what I felt was the best secure aspects of each one, also trying to figure out which was the most current tutorials.

Now I'm running into the same with CSS tutorials, finding good ones that are cross browser (standards strick) and that are up to date. Tons of tutorials from people who just know how to make IE look pretty Wink

If you have any more questions, let us know, we'll be glad to help.

-Greg

PS. I moved this to the database forum as that is the more appropriate section.

They have: 11 posts

Joined: Jul 2005

The server have indeed set up a database, I'm wondering how to get the data (fields, tables, etc.) from the Mysq database I've created locally to the server. I havn't any experiance in mysql/php and I'm just having trouble knowing where to start learning it!

The tutorial is from Web Monkey and the link is: http://webmonkey.wired.com/webmonkey/programming/php/tutorials/tutorial2.html

Cheers

They have: 222 posts

Joined: Sep 1999

Use the mysqldump command in your mysql bin directory to create a .sql file containing all of the data. You can then import the data from the .sql file to mysql on the new server.

The command goes something like

mysqldump -u (username) (databasename)

See http://dev.mysql.com/doc/mysql/en/mysqldump.html for more

They have: 5 posts

Joined: Sep 2005

Most of the ISP's that I've used have some flavour of phpMyAdmin running..like a previous poster mentioned. phpMyAdmin gives you a nice front end to easily manage your databases, tables, fields and data without having to be a SQL DBA.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.