简体   繁体   中英

Importing MySql Database to online web hosting site?

I'm doing this website and I first tested it locally. Everything works including the database. The form from the html automatically sends submitted data to my database. The problem is, I want to host it online. I already have the website. I use webfreehosting.net. How can I insert my database to the file manager? I checked out the mysql manager and it says it imports text files. But the database folder on my local disk has opt and frm files only.

使用mysqldump备份开发数据库,​​然后在生产系统上运行生成的SQL。

Export your local database from MySQL Workbench in SQL format (text files). Then, import the same into online database using PHPMyAdmin.

How can I insert my database to the file manager?

You do not. If you made the website, you should know that you did not use it. Use phpMyAdmin for SQL.

Also, if you application is not working then check if you have made configuration changes in the file, like username, password.

It looks like you are just starting out with web development. There are better, safer and faster ways to take MySQL dumps, but I would suggest you start with a graphical interface that aids in learning.

Your hosting provider would have provided you with a control panel. On their website , I can see that they provide phpMyAdmin. To import your database, you need to take the following steps:

  1. Download a desktop MySQL administrator like MySQL Workbench
  2. Export your database to a .SQL file
  3. Log in to your web hosting control panel.
  4. Create a Database.
  5. Create a Database user and set a password for this
  6. Grant this user all permissions to your database (not advisable, but its okay to start with)
  7. Find phpMyAdmin. You will see this database listed.
  8. Click on import and Import the database .sql file you created in step 2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM