Guys i want to make a system that can access a mysql database through the internet. Does this mean that i going to assign the IP address of my database server to the IP given by the provider? like for example 110.92.221.70.. is this valid as the ip address that i will use in the program? anyone who has an idea to solve this?

Dani AI

Generated

Yes — a VB client can use the public IP of the machine hosting MySQL (for example, 110.92.221.70) as the host in its connection string. That said, exposing MySQL directly to the Internet is risky. FTP is not a substitute for a database server (); FTP transfers files, it does not provide live DB access or transactions. For a distributed desktop application the safer, usual pattern is a middle tier (REST/HTTPS service) that the clients call; the service holds DB credentials and enforces auth, validation and rate limits.

If a direct MySQL connection is required, these are the practical steps and cautions:

  • Configure the server so MySQL listens on the external interface (my.cnf/my.ini bind-address) and open/forward TCP port 3306 on the firewall/router.

  • Create a MySQL account limited by host and privileges (better: specific client IPs, not '%'). Example:

    CREATE USER 'appuser'@'203.0.113.5' IDENTIFIED BY 'StrongPass';
    GRANT SELECT, INSERT, UPDATE ON mydb.* TO 'appuser'@'203.0.113.5';
    FLUSH PRIVILEGES;
  • Install MySQL Connector/ODBC and use ADO in VB6. Example connection string pattern:

    cn.ConnectionString = "Driver={MySQL ODBC 8.0 Driver};Server=110.92.221.70;Port=3306;Database=mydb;User=myuser;Password=mypassword;Option=3;"

Always use TLS/SSL for the DB connection, or better: an SSH tunnel or VPN to avoid sending credentials over the open Internet. Do not embed powerful DB credentials in distributed clients (they can be extracted); prefer a server-side API that issues short-lived tokens. MySQL connector docs and TLS guidance are useful starting points: see the MySQL Connector/ODBC docs (https://dev.mysql.com/doc/connector-odbc/en/) and MySQL encrypted connections guidance (https://dev.mysql.com/doc/refman/8.0/en/using-encrypted-connections.html).

Recommended Answers

All 2 Replies

Better to put the database in some FTP server and access that through the net using the Ip address with username and password for security.

can vb6 really do this type of setup? or vb.net? because the program will be distributed in different locations.. i've some people used protals with oracle database.. what is the usuall way of doing this?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.