-1

I am building a website which has database so it necessary to import database into the server ? What will happen if I don't import and keep on the local machine ?

I haven't tried it but I would like to know if the website still work and accept as well as store data if not imported ?

Will querying using API yield the same result ?

1 Answers1

0

This is a networking question.

A web server and the database that is used by its web pages can be on the same, or different, servers. However, there needs to be a TCP/IP (not "localhost" connection between them. Furthermore, the web server needs to be allowed to reach into the database server.

If the web server is some cloud-based server (or otherwise ISP-provided machine) and the database server is your personal laptop, then there are likely to be restrictions on the connection. (The opposite direction should be no problem.

Also, within MySQL, the GRANT that sets up the connection cannot be ... @localhost ..., but must be ... @11.22.33.44'` (or a hostname).

Rick James
  • 2,463
  • 1
  • 6
  • 13