5 Replies - 17417 Views - Last Post: 26 February 2011 - 06:21 AM Rate Topic: -----

#1 charllen  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-February 11

How can i access mysql database in LAN?

Posted 25 February 2011 - 08:16 PM

hi, I'm creating an Automated Inventory system and POS with Local Area Networking its for the final requirement for me to graduate i already finished the system but my problem is i don't know if how can i access my mysql Database via LAN. do i need to install wamp in all the pc/laptop i use? i already search for it through the internet but I'm still confuse the queries they return are all for websites are the procedures in networking my database in vb6 is the same? please help me.. thanks

Is This A Good Question/Topic? 0
  • +

Replies To: How can i access mysql database in LAN?

#2 Elda  Icon User is offline

  • D.I.C Regular

Reputation: 31
  • View blog
  • Posts: 314
  • Joined: 30-December 10

Re: How can i access mysql database in LAN?

Posted 25 February 2011 - 08:58 PM

You mean to Access database from server via web? or access database from the server via remote desktop.?
Was This Post Helpful? 0
  • +
  • -

#3 charllen  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-February 11

Re: How can i access mysql database in LAN?

Posted 26 February 2011 - 03:10 AM

View PostElda, on 25 February 2011 - 08:58 PM, said:

You mean to Access database from server via web? or access database from the server via remote desktop.?

actually via local area network only.. thanks for the reply
Was This Post Helpful? 0
  • +
  • -

#4 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,991
  • Joined: 08-June 10

Re: How can i access mysql database in LAN?

Posted 26 February 2011 - 03:35 AM

There are two things you need to do to access MySQL from a remote source (both LAN and the cloud).

First, you need to make sure your MySQL server allows remote connections. Do this by editing the my.cnf file (my.ini on Windows.)
# Set this to the IP address of your server machine.
bind-address = 65.55.55.2

# Make sure "skip-networking" is either commented out
# or removed completely.
# skip-networking



Then you need to allow your users to connect from a remote host. Do this by logging into the server as root (or a root-like user) and issuing a GRANT command.
GRANT SELECT, INSERT, UPDATE
ON mydb.*
TO 'username'@'host'
IDENTIFIED BY 'mypassword'


The host part of the TO clause can be an IP address or a domain name. It can also include a wild-card (%).
For example:
- TO 'username'@'192.168.1.%' Allows all on a typical lan
- TO 'username'@'%.lan' Again, works on all on some LANs
- TO 'username'@'%.example.com' All sub-domains of example.com allowed
- TO 'username'@'%' All hosts allowed. Usually not a good idea.

The SELECT, INSERT, UPDATE part is just a list of commands you are allowed to issue. Do ALL if you want all of them to be allowed. (Except super privileges, which is a much more complex issue.)
Was This Post Helpful? 0
  • +
  • -

#5 charllen  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 25-February 11

Re: How can i access mysql database in LAN?

Posted 26 February 2011 - 04:21 AM

View PostAtli, on 26 February 2011 - 03:35 AM, said:

There are two things you need to do to access MySQL from a remote source (both LAN and the cloud).

First, you need to make sure your MySQL server allows remote connections. Do this by editing the my.cnf file (my.ini on Windows.)
# Set this to the IP address of your server machine.
bind-address = 65.55.55.2

# Make sure "skip-networking" is either commented out
# or removed completely.
# skip-networking



Then you need to allow your users to connect from a remote host. Do this by logging into the server as root (or a root-like user) and issuing a GRANT command.
GRANT SELECT, INSERT, UPDATE
ON mydb.*
TO 'username'@'host'
IDENTIFIED BY 'mypassword'


The host part of the TO clause can be an IP address or a domain name. It can also include a wild-card (%).
For example:
- TO 'username'@'192.168.1.%' Allows all on a typical lan
- TO 'username'@'%.lan' Again, works on all on some LANs
- TO 'username'@'%.example.com' All sub-domains of example.com allowed
- TO 'username'@'%' All hosts allowed. Usually not a good idea.

The SELECT, INSERT, UPDATE part is just a list of commands you are allowed to issue. Do ALL if you want all of them to be allowed. (Except super privileges, which is a much more complex issue.)

hi i'am actually looking at my.ini right now but i dont know where to put those.. i attached my.ini in here.. if its ok with you can you tell me where to put it? thanks.

Attached File(s)

  • Attached File  my.txt (5.08K)
    Number of downloads: 896

Was This Post Helpful? 0
  • +
  • -

#6 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3719
  • View blog
  • Posts: 5,991
  • Joined: 08-June 10

Re: How can i access mysql database in LAN?

Posted 26 February 2011 - 06:21 AM

Ok, I see. This MySQL server is a part of some WAMP thing, right? Those sometimes mess with the configs a bit.

On line #48 there is #skip-networking, so I assume that would be the right place to put the bind-address directive. Just put it right below that on line #49.

Normally you put that into the [mysqld] part though. That's at the bottom of the file. You could put the bind-address directive there as well, just to be safe. I don't know how WAMP messes with things so that may be needed.

Best way to check if this is working is to just telnet into the MySQL server from a network machine. If the connection is accepted it's working.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1