This is a discussion on [newbie] not a very auspicious start within the MySQL Database forums, part of the Database Forums category; Kees Nuyt <k.nuyt@nospam.demon.nl> wrote: > On Sun, 24 Jun 2007 15:19:35 +0200, ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Kees Nuyt <k.nuyt@nospam.demon.nl> wrote:
> On Sun, 24 Jun 2007 15:19:35 +0200, desmond > <desmond@zeouane.org> wrote: > >>Jerry Stuckle <jstucklex@attglobal.net> wrote: >>> desmond wrote: >>>> Jerry Stuckle <jstucklex@attglobal.net> wrote: >>>>>> In other words, it works. So why can't I connect from within a php file? >>>>>> The password is _identical_ (I even copied and pasted it to make sure). >>>>>> This is annoying .. is there a typo that I can't see, or is it something, >>>>>> like some sort of 'rite of passage' that all newbies have to go through?? >>>>>> >>>>>> Help !! >>>>>> >>>>>> D. >>>>> Do you actually have your mysql socket at /var/mysql/mysql.sock? If >>>>> not, where is it? >>>>> >>>> /private/tmp/mysql.sock >>>> >>>> (it's a Mac). >>>> >>>> D. >>> >>> Then you need to specify it in your client section of your my.cnf (or >>> php.ini file). Right now PHP is using the default. >> >>/private/etc/my.cnf now looks like this... >> >>[mysqld] >>safe-user-create >>socket=/private/tmp/mysql.sock >> >>[client] >>port=3306 >>socket=/private/tmp/mysql.sock >> >>Same error. >> >>D. > > That's the MySQL config. > What's in your php.ini ? > > ; Default port number for mysql_connect(). If unset, mysql_connect() will use > ; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the > ; compile-time value defined MYSQL_PORT (in that order). Win32 will only look > ; at MYSQL_PORT. > mysql.default_port = > > ; Default socket name for local MySQL connects. If empty, uses the built-in > ; MySQL defaults. > mysql.default_socket = > There was nothing in them but I entered 3306 and /private/tmp/mysql.sock Restarted apache and MySQL. No joy. :( |
|
|||
|
desmond wrote:
> desmond <desmond@zeouane.org> wrote: > >> No joy. :( > > Duh. I'd put '/private/tmp/mysql.socket' > > Removed the feral 'et' and it works. > > Thanks, guys. You shouldn't need it in php.ini if your MySQL is set up properly. That way if you change the location of the socket you have one less file to remember to update. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
Jerry Stuckle <jstucklex@attglobal.net> wrote:
> desmond wrote: >> desmond <desmond@zeouane.org> wrote: >> >>> No joy. :( >> >> Duh. I'd put '/private/tmp/mysql.socket' >> >> Removed the feral 'et' and it works. >> >> Thanks, guys. > > You shouldn't need it in php.ini if your MySQL is set up properly. That > way if you change the location of the socket you have one less file to > remember to update. But it's in my my.cnf and that doesn't change things: i still can't connect, unless I do the above modif to php.ini. D. |
|
|||
|
desmond wrote:
> Jerry Stuckle <jstucklex@attglobal.net> wrote: >> desmond wrote: >>> desmond <desmond@zeouane.org> wrote: >>> >>>> No joy. :( >>> Duh. I'd put '/private/tmp/mysql.socket' >>> >>> Removed the feral 'et' and it works. >>> >>> Thanks, guys. >> You shouldn't need it in php.ini if your MySQL is set up properly. That >> way if you change the location of the socket you have one less file to >> remember to update. > > But it's in my my.cnf and that doesn't change things: i still can't > connect, unless I do the above modif to php.ini. > > D. Is it in this my.cnf file you're using? I compile my own mysql and set it in that compile configuration options. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
Jerry Stuckle <jstucklex@attglobal.net> wrote:
> desmond wrote: >> Jerry Stuckle <jstucklex@attglobal.net> wrote: >>> desmond wrote: >>>> desmond <desmond@zeouane.org> wrote: >>>> >>>>> No joy. :( >>>> Duh. I'd put '/private/tmp/mysql.socket' >>>> >>>> Removed the feral 'et' and it works. >>>> >>>> Thanks, guys. >>> You shouldn't need it in php.ini if your MySQL is set up properly. That >>> way if you change the location of the socket you have one less file to >>> remember to update. >> >> But it's in my my.cnf and that doesn't change things: i still can't >> connect, unless I do the above modif to php.ini. >> >> D. > > Is it in this my.cnf file you're using? yes.. [mysqld] #Don't allow new user creation by the user who has no write privileges to the mysql.user table. safe-user-create socket=/private/tmp/mysql.sock [client] port=3306 socket=/private/tmp/mysql.sock > I compile my own mysql and set it in that compile configuration options. I used a binary (gettin' lazy).. |
|
|||
|
desmond wrote:
> Jerry Stuckle <jstucklex@attglobal.net> wrote: >> desmond wrote: >>> Jerry Stuckle <jstucklex@attglobal.net> wrote: >>>> desmond wrote: >>>>> desmond <desmond@zeouane.org> wrote: >>>>> >>>>>> No joy. :( >>>>> Duh. I'd put '/private/tmp/mysql.socket' >>>>> >>>>> Removed the feral 'et' and it works. >>>>> >>>>> Thanks, guys. >>>> You shouldn't need it in php.ini if your MySQL is set up properly. That >>>> way if you change the location of the socket you have one less file to >>>> remember to update. >>> >>> But it's in my my.cnf and that doesn't change things: i still can't >>> connect, unless I do the above modif to php.ini. >>> >>> D. >> Is it in this my.cnf file you're using? > > yes.. > [mysqld] > #Don't allow new user creation by the user who has no write privileges to > the mysql.user table. > safe-user-create > socket=/private/tmp/mysql.sock > > [client] > port=3306 > socket=/private/tmp/mysql.sock > >> I compile my own mysql and set it in that compile configuration options. > > I used a binary (gettin' lazy).. Hmmm, the whole reason for having the client is to make it available to those who ask. OTOH, that may be used only for the MySQL client - I'm not sure. But since you got it working from the php.ini file, it looks like your good to go. -- ================== Remove the "x" from my email address Jerry Stuckle JDS Computer Training Corp. jstucklex@attglobal.net ================== |
|
|||
|
Jerry Stuckle <jstucklex@attglobal.net> wrote:
>>> I compile my own mysql and set it in that compile configuration >>> options. >> >> I used a binary (gettin' lazy).. > > Hmmm, the whole reason for having the client is to make it available to > those who ask. > > OTOH, that may be used only for the MySQL client - I'm not sure. But > since you got it working from the php.ini file, it looks like your good > to go. It does..now I just need to learn php. :-\ Thanks for the help. :-) |