vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Searched google, groups google, read the manuals, and finally I turn to others. Here's my situation: I have an installation of OpenBSD 3.4 on a machine. On it, I've installed mysql client and server. So far, I can connect to the mysql server just fine. Of course, there's always the exciting initial: /usr/local/bin/mysqladmin -u root password 'new-password' /usr/local/bin/mysqladmin -u root -h localhost password 'new-password' As specified by the mysql server install. Of course, the second command should really be: /usr/local/bin/mysqladmin -u root -p -h localhost password 'new-password' Since after you do the first command, the second command wants a password. Anyway, using: mysql -u root -p And entering the password, I can get into mysql just find and play around on the command line. So, then I've installed PHP4 and the mysql extensions. I've confirmed those work, since I've put phpmyadmin into the /var/www/htdocs/phpmyadmin directory, and it runs all right. No complaints about "mysql_connect" bad command or such. Well, almost all right. When I run phpmyadmin, I've got the settings for "cookie", "localhost" is the server. So when I launch phpmyadmin and it gives me the "enter username/password", I enter in: root password (Yes, I know I shouldn't be running as root, but right now I'm just trying to get it running.) So here's the response I get my our friend phpmyadmin: "Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2)" So I know the server is running - mysql.sock is sitting right there, I can connect via the command line so I know mysql server is "happy happy". So this leaves me with the problem: Why does the mysql command line client connect to the mysql server, but the phpmyadmin - using the same username/password - craps out with that error? Thanks for any help. |
| |||
| i have not used phpmyadmin, but i assume it runs through your httpd, which is chrooted by default. this means httpd is confined to /var/www or whatever you specify as chroot directory. hence, it cannot access the mysql socket located outside this directory. i can't remember what works best, but you can try to - ln -s /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock - or start mysqld with option --socket=/var/www/var/run/mysql/mysql.sock then httpd will see it as /var/run/mysql/mysql.sock, the default socket location used by PHP's mysql_connect. note that, if you are providing a server name instead of an IP number to mysql_connect or to any other function, you may also have to copy /etc/resolv.conf to /var/www/etc/resolv.conf, else PHP will not be able to lookup the name you provided. if it all works, you should edit your /etc/rc.local accordingly to have your httpd and mysqld coexist happily by default. steven. |
| |||
| Mr. Mestdagh, you are my personal hero. Sorry, folks - this is my first time with BSD (aka - UNIX for the paranoid Once I changed in the /etc/rc.conf file the httpd="-u" which lets it go outside of /var/www, everything was happy. It's one of those "obvious now that I see it" kinds of things - and it makes sense from a security point of view. Now I just have to decide which I want to live with - putting my mysql socket into /var/www directory somewhere (more secure, but could cause headaches later with other apps looking for it in the "default" position), or leaving it as is and running "-u". (Probably the latter, as I'm not looking for bulletproof security on this box). Again, thanks for your help. And they say that BSD people can only reply with RTFM DP steven mestdagh <smestdag@_NOSPAM_esat.kuleuven.ac.be> wrote in message news:<Pine.LNX.4.58.0401040110050.444@batcher.esat .kuleuven.ac.be>... > i have not used phpmyadmin, but i assume it runs through your httpd, which > is chrooted by default. this means httpd is confined to /var/www or > whatever you specify as chroot directory. hence, it cannot access the > mysql socket located outside this directory. |
| ||||
| If you connect to 127.0.0.1 instead of localhost you will be connected thru a inet connection instead of a unix domain socket and can keep http chrooted. Just add an entry in mysql/user. -- Peter Strömberg C2K2 C2K3 ISCCIV02 ISCCIV03 |