How to import .MDF Database?

Hi, how can I import my database to a webhost?

  • I have only ftp access, I I've alrady back up the database from sqlyog as db.sql.

  • Answer:

    You can only use the type of database they allow you. Generally any hosting service who allows database use will offer mysql. In this case they should allow you a login to manage it. You then use that login to create a new database user just to run the sql from your scripts. Do NOT use the admin login (maybe called root login) they give you for this as it has too much power and an attacker can get total control on your system. You should give the new user rights to all tables in your database, but NOT allow GRANT rights. Also if you use no delete actions on the database do not allow the new user delete rights. You can then write a php script to create a connection as the admin user and run the .sql file in your document root. This can all be in one page, so you could paste the text of the .sql file into the php page. Then just browse to the file to make it create the new database. Maybe call it setup.php. As soon as you have the database created set the connection in your web site pages to the new user details. Then delete the setup file from the site, it is dangerous.

jay at Yahoo! Answers Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.