You are not logged in.

#1 2012-04-01 23:58:21

ssl6
Member
From: Ottawa, ON, CA
Registered: 2007-08-30
Posts: 594

[SOLVED] Connecting to Mysql server

I'm having some issues connecting to a mysql server remotely. I've had the server running for a while and never had a need to connect to mysql this way so I really don't know how long it's been broken, or if it ever worked for that matter.

I do have the skip-networking line commented out

and i also have this setup

#
# /etc/hosts.allow
#
mysqld : ALL : ALLOW
mysqld-max : ALL : ALLOW




I don't understand why I can't connect to it, its 20ft away from me in a cabinet

================================================================
Solved it. I managed to get a hold of a friend who found me this link, followed the steps and solved my issue.

http://howtogeek.com/howto/programming/ … -any-host/

Last edited by ssl6 (2012-04-04 11:25:59)


this is a signature

Offline

#2 2012-04-02 05:25:06

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] Connecting to Mysql server

Not exactly alot of info to go on here. What happens exactly when you try to connect, what's in the logs, can you telnet to the listening port,...?


Burninate!

Offline

#3 2012-04-02 10:26:23

ssl6
Member
From: Ottawa, ON, CA
Registered: 2007-08-30
Posts: 594

Re: [SOLVED] Connecting to Mysql server

the error I get on the windows machine i'm trying to connect from is just saying that its not allowed to connect. maybe this will help, if i log into the server via ssh and punch in these commands, here's what i get

[administrator@srv-web lib]$ mysqladmin -h `hostname` version variables
mysqladmin: connect to server at 'srv-web' failed
error: 'Host 'srv-web.sergeinc.org' is not allowed to connect to this MySQL server'
[administrator@srv-web lib]$ mysqladmin -h localhost version variables
mysqladmin  Ver 8.42 Distrib 5.5.22, for Linux on x86_64
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Server version          5.5.22-log
Protocol version        10
Connection              Localhost via UNIX socket
UNIX socket             /var/run/mysqld/mysqld.sock
Uptime:                 9 hours 21 min 36 sec

Threads: 1  Questions: 113  Slow queries: 0  Opens: 49  Flush tables: 1  Open tables: 42  Queries per second avg: 0.003

where do I allow host names to connect to the mysql server, i don't get it, it's in the hosts.allow list, but clearly that's not it. when even the servers own host name cannot get access, but localhost can? you'd think it would be the same thing when you're on the server!?!?

i've been going through this link and can't seem to find anything to help me
http://dev.mysql.com/doc/refman/5.5/en/ … erver.html

Last edited by ssl6 (2012-04-02 10:36:35)


this is a signature

Offline

#4 2012-04-02 11:57:29

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] Connecting to Mysql server

Make sure you have the correct bind-address configured (the ip you want mysqld to approachable on) in your config. If this is left blank, mysqld will only listen on localhost.


Burninate!

Offline

#5 2012-04-02 12:11:00

yaffare
Member
Registered: 2011-12-29
Posts: 71

Re: [SOLVED] Connecting to Mysql server

in the table mysql.user there is a column     Host, it must contain 192.168.% for example or just % to allow every host.

just add another line in that table for the root user. then run FLUSH PRIVILEGES

snapshot1ng.png


systemd is like pacman. enjoys eating up stuff.

Offline

#6 2012-04-02 13:28:53

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: [SOLVED] Connecting to Mysql server

Have you commented out or removed "skip-networking" in /etc/mysql/my.cnf?
https://wiki.archlinux.org/index.php/My … ote_access


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#7 2012-04-02 15:21:13

ssl6
Member
From: Ottawa, ON, CA
Registered: 2007-08-30
Posts: 594

Re: [SOLVED] Connecting to Mysql server

@Gcool

is this to day that if my servers ip address is 10.66.1.10, then i should use "bind-address=10.66.1.10"

@Cdh
yes it's commented out, i thought i mentioned that in my first post

@yaffare
i'm not the most knowledgeable still with mysql, and for the moment i'm going to have to do that via command line, any help you can provide for this...?


this is a signature

Offline

#8 2012-04-02 15:35:15

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: [SOLVED] Connecting to Mysql server

I believe Arch dropped tcp_wrappers a while ago, which means that hosts.allow and hosts.deny does not work anymore. So that's not where your problem lies.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#9 2012-04-02 16:13:40

ssl6
Member
From: Ottawa, ON, CA
Registered: 2007-08-30
Posts: 594

Re: [SOLVED] Connecting to Mysql server

ok, i've managed to login via cli interface and selected the mysql database, now when i show columns from the table host that yaffare mentioned, I get this

mysql> show columns from host;
+-----------------------+---------------+------+-----+---------+-------+
| Field                 | Type          | Null | Key | Default | Extra |
+-----------------------+---------------+------+-----+---------+-------+
| Host                  | char(60)      | NO   | PRI |         |       |
| Db                    | char(64)      | NO   | PRI |         |       |
| Select_priv           | enum('N','Y') | NO   |     | N       |       |
| Insert_priv           | enum('N','Y') | NO   |     | N       |       |
| Update_priv           | enum('N','Y') | NO   |     | N       |       |
| Delete_priv           | enum('N','Y') | NO   |     | N       |       |
| Create_priv           | enum('N','Y') | NO   |     | N       |       |
| Drop_priv             | enum('N','Y') | NO   |     | N       |       |
| Grant_priv            | enum('N','Y') | NO   |     | N       |       |
| References_priv       | enum('N','Y') | NO   |     | N       |       |
| Index_priv            | enum('N','Y') | NO   |     | N       |       |
| Alter_priv            | enum('N','Y') | NO   |     | N       |       |
| Create_tmp_table_priv | enum('N','Y') | NO   |     | N       |       |
| Lock_tables_priv      | enum('N','Y') | NO   |     | N       |       |
| Create_view_priv      | enum('N','Y') | NO   |     | N       |       |
| Show_view_priv        | enum('N','Y') | NO   |     | N       |       |
| Create_routine_priv   | enum('N','Y') | NO   |     | N       |       |
| Alter_routine_priv    | enum('N','Y') | NO   |     | N       |       |
| Execute_priv          | enum('N','Y') | NO   |     | N       |       |
| Trigger_priv          | enum('N','Y') | NO   |     | N       |       |
+-----------------------+---------------+------+-----+---------+-------+
20 rows in set (0.00 sec)

mysql>

now where too, if i need to allow access in here....


this is a signature

Offline

#10 2012-04-02 16:42:39

Gcool
Member
Registered: 2011-08-16
Posts: 1,456

Re: [SOLVED] Connecting to Mysql server

ssl6 wrote:

@Gcool
is this to day that if my servers ip address is 10.66.1.10, then i should use "bind-address=10.66.1.10"

Exactly. You should also be able to see which ip it's currently listening on (if any) by running "ss -l".


Burninate!

Offline

#11 2012-04-02 17:09:16

ssl6
Member
From: Ottawa, ON, CA
Registered: 2007-08-30
Posts: 594

Re: [SOLVED] Connecting to Mysql server

well, bind address is set correctly and verified, but still can't connect from the other machine, ughr.....

i'm sure its the permissions within mysql at this point, I just dont know how to set that

Last edited by ssl6 (2012-04-02 17:11:56)


this is a signature

Offline

Board footer

Powered by FluxBB