Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
MySQL remote access
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
sjames1010
n00b
n00b


Joined: 06 Jun 2003
Posts: 10

PostPosted: Wed Jun 23, 2004 2:30 pm    Post subject: MySQL remote access Reply with quote

This question has been asked multiple times, but none of the answers have worked for me. The MySQL ebuild really needs to be better at easy configuration. There should be a HowTo on this. If I ever get it working maybe I'll write one.

list of dups (please don't mark this as one, these did not help me)
https://forums.gentoo.org/viewtopic.php?t=162233
https://forums.gentoo.org/viewtopic.php?t=149985
https://forums.gentoo.org/viewtopic.php?t=118648
https://forums.gentoo.org/viewtopic.php?t=38377
https://forums.gentoo.org/viewtopic.php?t=26815

I can login to mysql with:
Code:
mysql -u root -p

but not with:
Code:
mysql -h phoenix2 -u root -p
Enter password:
ERROR 2013: Lost connection to MySQL server during query

(phoenix2 is the machine's hostname)
In other words, I cannot log in except from the localhost.

my.cnf includes the lines:
Code:

bind-address    = 0.0.0.0
port            = 3306
# this can make it even more secure:
#skip-networking

hosts.allow is:
Code:
mysqld: ALL

hosts.deny is empty
netstat shows:
Code:
netstat -lntp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      22709/
tcp        0      0 0.0.0.0:6667            0.0.0.0:*               LISTEN      22272/bitlbeed
tcp        0      0 0.0.0.0:8080            0.0.0.0:*               LISTEN      22584/
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      22534/perl
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      22229/apache2
tcp        0      0 0.0.0.0:723             0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:8021            0.0.0.0:*               LISTEN      22584/
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      22486/vsftpd
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      22442/sshd
Back to top
View user's profile Send private message
rmalolepszy
Apprentice
Apprentice


Joined: 01 Jan 2004
Posts: 167

PostPosted: Wed Jun 23, 2004 3:05 pm    Post subject: Reply with quote

Is your user allowed to log in from non-localhost in your user table?
_________________
Cheers,
Ryan
Back to top
View user's profile Send private message
sjames1010
n00b
n00b


Joined: 06 Jun 2003
Posts: 10

PostPosted: Wed Jun 23, 2004 3:57 pm    Post subject: user permissions Reply with quote

I think this is set up correctly. I used the webmin mysql module.

Code:
mysql -u root -p mysql
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1 to server version: 4.0.20
                                                                                                                               
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
                                                                                                                               
mysql> select user,host,password from user;
+-------+-----------+------------------+
| user  | host      | password         |
+-------+-----------+------------------+
| root  | localhost | **************** |
| root  | phoenix2  | **************** |
...
Back to top
View user's profile Send private message
rmalolepszy
Apprentice
Apprentice


Joined: 01 Jan 2004
Posts: 167

PostPosted: Wed Jun 23, 2004 7:55 pm    Post subject: Reply with quote

phoenix2 is the host your connecting from?
_________________
Cheers,
Ryan
Back to top
View user's profile Send private message
banadushi
n00b
n00b


Joined: 26 Jun 2003
Posts: 37
Location: San Antonio, TX USA Earth

PostPosted: Wed Jun 23, 2004 7:59 pm    Post subject: Reply with quote

More than likely 'phoenix2' is not resolveable by the machine, is it in your /etc/hosts can you ping 'phoenix2' from your MySQL server's console?

For speed and effeciency you should be using IP's for host grants, not hostnames, then turning off name resolution. This will speed up MySQL alot, if you have a very busy database server.

Happy Hacking!
Back to top
View user's profile Send private message
sjames1010
n00b
n00b


Joined: 06 Jun 2003
Posts: 10

PostPosted: Thu Jun 24, 2004 2:16 pm    Post subject: Reply with quote

Yes phoenix2 is the host I'm connecting from.

/etc/hosts does have phoenix2 in it, but it has sounded like a name resolution problem to me, too. I added "skip-name-resolve" to /etc/mysql/my.cnf. Is this the proper way to disable name resolution?

Code:
mysql -u root -h 64.205.232.136
ERROR 2013: Lost connection to MySQL server during query

(I removed the passwords)
This is getting rather frustrating. I noticed that the init script starts mysql from "/usr/bin/mysqld_safe" ... Is this a problem? It seems like just a script to keep mysql alive when it dies.
Back to top
View user's profile Send private message
Herring42
Guru
Guru


Joined: 10 Mar 2004
Posts: 373
Location: Buckinghamshire

PostPosted: Tue Jul 06, 2004 5:34 am    Post subject: I've just fixed this. Reply with quote

Stupidly, I made two changes at once, so I don't know which one cured the problem, but I upgraded to the latest ~x86 version of MySql, and at the same time compiled without tcp wrappers support.
Code:

ACCEPT_KEYWORDS="~x86" USE="-tcpd" emerge -v mysql


This has upgraded me to version 4.0.20.

Hope this helps you too.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum