How to give permission to other PC to add data to my database in MySQL.in my computer

前端 未结 1 1892
慢半拍i
慢半拍i 2021-01-29 11:04

I made a python program here and i wanted to send the code to my friend and he was unable to add values through the program to my database, is there a way i can allow his access

相关标签:
1条回答
  • 2021-01-29 12:05

    This is happening because you are running MySQL locally on your computer (as given by your use of 127.0.0.1). In other words, you have a process/program (MySQL) running in the background of only your computer. For your friend to have access to this database, you will need to either of two things:

    1. Expose your MySQL instance (running on your computer) to the world.
      • This has its limitations. If you turn off your computer, or don't have access to the internet, you are effectively shutting down the MySQL instance from the rest of the world.
      • Involves port-forwarding and the sort -- which can be cumbersome.
    2. Use an external service (website provider) to run an instance of an MySQL database that can be accessed by anyone on the internet.
      • Google: "free mysql provider." You'll find a few results that allows you to create free MySQL databases with limitations (usually size limitation).
      • Instead of connecting to 127.0.0.1, you would connect to a mysql://website.com:33060/path/to/your/database

    Method 2 is the easiest. You can use free services online to create a MySQL server that you and your friend can access.

    0 讨论(0)
提交回复
热议问题