By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,483 Members | 1,052 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,483 IT Pros & Developers. It's quick & easy.

Embedded MySQL Server cannot connect (C-API)?

P: n/a
Hi,

I want to set up a mysql server in an embedded process. I managed to start
the server in my program as described through

mysql_server_init()

Now I need a client connection to this server.

mysql_real_connect

tells me that it could not connect to the server through the
UNIX Domain socket.

How can I tell my client to connect to the embedded server ?

TIA

INGO
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
There is a little mis-conception in the way MySQL configured. When we
got problem like this then we thought it is something related to the
network or configuration file. However, it is not. I got the same
problem before and luckily I figured it out. Here are the steps you
need to check:

1. Make sure you are able to ping the server onwhich the database
located

ping <target_server_ip_address>

This to make sure the the server is accessible through TCP/IP

2. Telnet into the server at port 3306 (presumably that you use the
default port for MySQL)

telnet <target_server_ip_address> 3306

If you got something is connection refuse then you are FINE. What it
means is it is allowed you to "talk" to it but it doesn't allow you to
make CONNECTION to the port.

3. Now the step you needs to make it works: on the server that hosts
the database do the following:

a. connect to the database manually

# mysql --user=root --password=<your database root password>

b. Assign the neccessary privilege

mysql> GRANT ALL PRIVILEGES ON db.* TO ''@'';

c. log off the database (either exit or quit will work :-)

Now you should be able to connect to the database from ANY WHERE by
ANY USER. The command on b. will let you do that. For more info
about this (such as restrict a specific user or machine from a DNS
domain, to anything else is completedly describe on chapter 5 of the
MySQL manual (5.5.5 is more specific).
BTW, did you got your MySQL database run on your embedded system ? I
have the problem to get my MySQL database server to run on my SBC.
Any pointer or what are the steps that you get it done ? I posted
another message with full details about my problem on this news group
as well. If you can help then please. Thanks.

Good luck.


i.******@dokom.net (ikrabbe) wrote in message news:<e4**************************@posting.google. com>...
Hi,

I want to set up a mysql server in an embedded process. I managed to start
the server in my program as described through

mysql_server_init()

Now I need a client connection to this server.

mysql_real_connect

tells me that it could not connect to the server through the
UNIX Domain socket.

How can I tell my client to connect to the embedded server ?

TIA

INGO

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.