Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Here is the technical description.

My laptop's config:

  • IP Adress:192.168.2.5
  • MySQL Server 5.0 on port 3306
  • Operating System: Ubuntu
  • The database is in this machine

My friend's laptop config:

  • IP Adress:192.168.2.4
  • MySQL Server 5.0 on port 3306
  • Operating System: Windows XP

Both are on a wireless LAN connected through a Belkin router (192.168.2.1). I put this but its not working:

url = "jdbc:mysql://192.168.2.5:3306/Database"

How can I configure things connect to this database?

share|improve this question

migrated from serverfault.com May 31 '12 at 21:26

This question came from our site for professional system and network administrators.

    
Questions about home networks and personal computers are off-topic per the faq –  MDMarra May 31 '12 at 12:59

3 Answers 3

MySQL is a TCP protocol running on port 3306 by defauly, hence there is nothing special beyond ensure that you have enabled binding to a public IP address in the /etc/my.cnf file;

port            = 3306
bind-address            = 0.0.0.0

On the client you would need to install the jdbc drivers for MySQL;

For windows XP they can be downloaded from here;
http://dev.mysql.com/downloads/connector/j/

For ubuntu, there are package version in the repository;

# aptitude search mysql | grep JDBC
p   libmysql-java                   - Java database (JDBC) driver for MySQL 

You can use any client, mysql provide a workbence tools product;
http://dev.mysql.com/downloads/workbench/5.2.html

or you can use Libreoffice and their database connection to view the tables;
http://www.libreoffice.org/features/base/

Or use a scripting language like php;
http://php.net/manual/en/book.mysql.php

or even just the command line client;

$ mysql -h192.168.2.5 -uuserXXX -e "show databases;"
+--------------------+
| Database           |
+--------------------+
| information_schema | 
| badger1             | 
| cacti              | 
share|improve this answer
    
thank you very much for your answer. my friend can access to my database in windows xp but my goal is to access to ** his database in ubuntu**. i have windows xp –  waelbk May 31 '12 at 13:03
    
how do you wish to access it?, is the database already running in Ubuntu, or do you need to install it? –  Tom H May 31 '12 at 13:33
    
i found a solution thanks for your help –  waelbk May 31 '12 at 19:18
    
$ mysql -u root -p Enter password: mysql> use mysql mysql> GRANT ALL ON . to root@'192.168.2.4' IDENTIFIED BY 'your-root-password'; mysql> FLUSH PRIVILEGES; –  waelbk May 31 '12 at 19:23

This might sound stupid but have you checked if your Ubuntu machine has its firewall running? That has tripped me up a few times on both Windows and Linux.

A quick check is to run: sudo iptables -L

Here is a how-to from the ubuntu site: https://help.ubuntu.com/community/IptablesHowTo

share|improve this answer

Have you configured remote access for your MySQL server ? If not, read this.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.