0

i am trying to connect to mysql using php, but not locally, like from a .com, for example. i have seen a question about connecting from python, but not from php. (also, please tell me what is the word for non-local, like not in c drive, but on a domain and stuff.)

i have tried connecting using ipv4 address, but it did not work. four components that i need: dbhost, dbuser, dbpass, and db.

first, is that possible, and second, if it is, how i would do it, with an example of the four components.

please tell me everything i will need to do to make this happen.

thank you for your help.

jackson
  • 19
  • 2

1 Answers1

0
  1. it is possible
  2. change the value for bind_address from 127.0.0.1 to 0.0.0.0 in my.cnf on the server
  3. restart mysql on the server
  4. replace the mysql host in your php file connection params from localhost to the server IP/Domain name.
Satya
  • 8,693
  • 5
  • 34
  • 55