Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

MySQL scheme connection problem

 [1/5] from: chris:starforge at: 21-Jul-2001 17:36


Hi, I'm trying to use the MySQL scheme on my site and I have encountered some problems. If I ssh into my hoster and try to connect to localhost: mysql --user=starforg_chris --password=xxxxxx starforg_siteserv and it connects fine. But if I use rebol:
>> do %mysql-protocol.r >> db: open mysql://starforg_chris:[xxxxxx--localhost]/starforg_siteserv
** User Error: ERROR 1045: Access denied for user: ['starforg_chris--wolverine--uk--co'] Anyone know what I'm doing wrong here? :/ Chris -- New sig in the works Explorer2260, Designer and Coder http://www.starforge.co.uk -- If you only have a hammer, you tend to see every problem as a nail. -- Maslow

 [2/5] from: mccarter:uniserve at: 21-Jul-2001 18:57


Hi Chris, I ran into this also. You have to grant permissions specifically to the rebol user name, AND the source address. For instance I had to grant permissions to rebuser:xxxxx 127.0.0.1 to use rebol access to MySql from the localhost. I had to grant rebuser:xxxxx 192.168.1.2 for another machine on the private network. Or you can give your user a wildcard "*" access "from" and you can access from anywhere. Bill. Chris wrote:

 [3/5] from: chris::starforge::co::uk at: 22-Jul-2001 9:35


On 22-Jul-01, MCCUNI wrote:
> Or you can give your user a wildcard "*" access "from" and you can access > from anywhere.
Thanks to help from my hoster I got this fixed. Now for the weirdness: I have MySQL, Apache and other tools set up on my linux box so that it is practically a mirror of my website. 99% of the time, if it works on my home system I can upload it to the website and be sure it'll work. This is the case with my sql scripts - at home I could do db: open mysql://starforg_chris:[xxxxx--localhost]/starforg_siteserv and it worked fine. But when I uploaded the script to my website it failed? After a bit of investigation, I found a possible reason. When I used @localhost on my website mySQL was seeing "wolverine.uk.co" rather than "localhost". All I can think is that the mySQL scheme is resolving localhost as part of the open (I have no idea if this is true, half the code in the scheme is Greek to me..) So instead of logging in as starforge_chris:[xxx--localhost] I was actually logging in as starforg_chris:[xxxx--wolverine--uk--co] My hoster added an entry to mysql.user to allow me to connect from wolverine.uk.co and everything works fine now. What I can't understand is why localhost is being resolved or why mySQL can't work out that wolverine.uk.co IS localhost. But it works now anyway :) Chris -- New sig in the works Explorer2260, Designer and Coder http://www.starforge.co.uk -- Somebody ought to cross ball point pens with coat hangers so that the pens will multiply instead of disappear.

 [4/5] from: ptretter:charter at: 22-Jul-2001 9:32


What if you just added 127.0.0.1 instead of localhost. Paul Tretter

 [5/5] from: dockimbel:free at: 23-Jul-2001 11:59


Hi Chris, When the mysql client connect locally, it use Unix local sockets intead of TCP. Use the 'status command under mysql and see the "Connection:" line. In that case, your [name--host] doesn't seem to be resolve. When you use my scheme, it always connect in TCP mode. So, the host is resolve by Rebol (to 127.0.0.1, when you connect locally) and then a reverse-dns is applied in the mysql server. If it doesn't find any matching entries in his 'user table, your connection is rejected. See what does the following command under your server's unix account :
>> read dns://127.0.0.1
I guess you'll obtain : == wolverine.uk.co ! So, in order to use my scheme under your server, you have to grant access to either [yourlogin--127--0--0--1] or [yourlogin--wolverine--uk--co] . HTH, DocKimbel. Chris wrote: