Re: [PHP] Problems connecting to mysql



On 6/9/07, Tom Cruickshank <tcruicksh@xxxxxxxxx> wrote:
It is definitely on a separate machine.

I have host as '%' in the user table in the mysql database.
When I used the command line "mysql -u some_user -p -h xxx.xxx.xxx.xxx
It was in a local and remote setting (ie, done in the linux machine and
freebsd machine).

If it didn't work via command line, it would give me a starting point to
work on, as of right now, I just don't get it. I'm starting to think
something somewhere is not compatible or configured. But in my opinion it
*should* be possible to connect from a linux to bsd box and vice versa.


Hope this Helps.

Tom

Ok, did you check the logs of Apache if any detailed error is reported?

And what about the logs of your MySQL server on the FreeBSD box?

Oh, and PHP code maybe?

Tijnema


-----Original Message-----
From: Tijnema [mailto:tijnema@xxxxxxxxx]
Sent: June 8, 2007 7:00 PM
To: Tom Cruickshank
Cc: php-general@xxxxxxxxxxxxx
Subject: Re: [PHP] Problems connecting to mysql

On 6/9/07, Tom Cruickshank <tcruicksh@xxxxxxxxx> wrote:
> Hello,
> I was using a FAMP (FreeBSD Apache MySQL PHP) server for some web
> development I was doing. Then I had to switch over the php pages to a
Linux
> box, however, the database is still on FreeBSD. Does that make any
> difference?
>
> The reason why I ask is because I keep getting this error.
>
> I use "die ('Could not connect: ' . mysql_error());"
> Could not connect: Can't connect to MySQL server on xxx.xxx.xxx.xxx (13).
>
> If I use "die ('Could not connect: ' . mysql_errno());"
> Could not connect: 2003
>
> I did some research on error 2003 and it appears that I would see this if
> communication access was not established.
>
> However, if I try connecting to the mysql database using the command line
> I have no problems.
>
> Mysql -u some_user -p -h xxx.xxx.xxx.xxx
>
> This only started after I started using linux as web server and freebsd as
> database.
>
> If there is a more appropriate mailing list to ask this questions, please
> feel free to direct me towards it.
>
> Tom
>
Since the database is on FreeBSD, it's a seperate machine?
This probably means that you're not allowed to connect to the machine
by LAN, but only through localhost, and you should take a look at your
mysql config file on the FreeBSD machine.
Where do you run the command line? on your freeBSD machine or your Linux
box?

Tijnema

Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.6.1/778 - Release Date: 27/04/2007
1:39 PM


Internal Virus Database is out-of-date.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 269.6.1/778 - Release Date: 27/04/2007
1:39 PM



.



Relevant Pages

  • RE: FreeBSD 5.3 MySQL Performance
    ... versions of Linux and FreeBSD for most tests. ... > popular with the ATA disk drive manufacturers. ... > Many companies have used FreeBSD and MySQL for years and years. ... it is not often that you have such a small database and such a large ...
    (freebsd-questions)
  • Re: (mySQL) benchmarks strike back
    ... > advocacy for FreeBSD, so I'm sure my boss is going to ... That particulary example used a very small database that was cached ... Linux mounts its filesystems in async mode by default. ... state of threading than any realistic database system. ...
    (freebsd-questions)
  • What am I doing wrong with MOUNT?
    ... I'm brand new to FreeBSD and Unix world in general. ... I installed MySQL version 3.23 from the ports ... of his database that I had MySQL dump on his FreeBSD server and FTP'd it to ... I mounted the new drive 1 to a temporary mount point and used the cp command ...
    (freebsd-newbies)
  • Re: FreeBSD MySQL still WAY slower than Linux
    ... is that the Mysql folks have agreed to setup ... >tests to profile mysql on identical hardware running FreeBSD and Linux ... I was seeing the same sort of super-smack numbers that everyone's been ...
    (freebsd-stable)
  • Re: What am I doing wrong with MOUNT?
    ... > I'm brand new to FreeBSD and Unix world in general. ... > site supported by FreeBSD that uses MySQL. ... > of his database that I had MySQL dump on his FreeBSD server and FTP'd it to ... > I mounted the new drive 1 to a temporary mount point and used the cp command ...
    (freebsd-questions)