View previous topic :: View next topic |
Author |
Message |
sjames1010 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 06 Jun 2003 Posts: 10
|
Posted: Wed Jun 23, 2004 2:30 pm Post subject: MySQL remote access |
|
|
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:
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:
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 |
|
![](templates/gentoo/images/spacer.gif) |
rmalolepszy Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 01 Jan 2004 Posts: 167
|
Posted: Wed Jun 23, 2004 3:05 pm Post subject: |
|
|
Is your user allowed to log in from non-localhost in your user table? _________________ Cheers,
Ryan |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
sjames1010 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 06 Jun 2003 Posts: 10
|
Posted: Wed Jun 23, 2004 3:57 pm Post subject: user permissions |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
rmalolepszy Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
Joined: 01 Jan 2004 Posts: 167
|
Posted: Wed Jun 23, 2004 7:55 pm Post subject: |
|
|
phoenix2 is the host your connecting from? _________________ Cheers,
Ryan |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
banadushi n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 26 Jun 2003 Posts: 37 Location: San Antonio, TX USA Earth
|
Posted: Wed Jun 23, 2004 7:59 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
sjames1010 n00b
![n00b n00b](/images/ranks/rank_rect_0.gif)
Joined: 06 Jun 2003 Posts: 10
|
Posted: Thu Jun 24, 2004 2:16 pm Post subject: |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
Herring42 Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
![](images/avatars/483898803440804b6d5eb0.jpg)
Joined: 10 Mar 2004 Posts: 373 Location: Buckinghamshire
|
Posted: Tue Jul 06, 2004 5:34 am Post subject: I've just fixed this. |
|
|
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 |
|
![](templates/gentoo/images/spacer.gif) |
|