Re: Joomla - MySQL Problem: Could not connect to MySQL
Not quite a solution, I think. What about if /var/www mounts in a different filesystem than /var? Hardlinks from chrooted environments don't seem to be a wise solution anyway... Just IMHO. Regards, Dani El 12/03/2010 12:16, Sunnz escribiC3: 2010/3/11 Janmalepa...@googlemail.com: I didn't notice, that httpd was still running. kill -TERM ID_of_httpd httpd -u solved the problem. Thank you! Everything works fine! Now that it works we know that it was a problem with chroot. It might be a good practice now to hardlink the mysql.sock in the chroot directory so that you can run apache chrooted... I think you do something like: # mkdir -p /var/www/var/run/mysql # ln -f /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock Then if you shut down httpd and start it again, you shouldn't need -u any more.
Re: Joomla - MySQL Problem: Could not connect to MySQL
On Fri, Mar 12, 2010 at 6:58 PM, Daniel Gracia Garallar danie...@electronicagracia.com wrote: Not quite a solution, I think. What about if /var/www mounts in a different filesystem than /var? how about - tell mysql to create sock file in /var/www/var/run/mysql; or - tell php to connect to mysql over tcp/ip -- O ascii ribbon campaign - stop html mail - www.asciiribbon.org
Re: Joomla - MySQL Problem: Could not connect to MySQL
2010/3/12 Daniel Gracia Garallar danie...@electronicagracia.com: Not quite a solution, I think. What about if /var/www mounts in a different filesystem than /var? Hardlinks from chrooted environments don't seem to be a wise solution anyway... Just IMHO. In that case you could change the location mysqld itself uses to be inside the chroot. Or do you actually have a solution?
Re: Joomla - MySQL Problem: Could not connect to MySQL
On Sat, 13 Mar 2010, Sunnz wrote: 2010/3/12 Daniel Gracia Garallar danie...@electronicagracia.com: Not quite a solution, I think. What about if /var/www mounts in a different filesystem than /var? Hardlinks from chrooted environments don't seem to be a wise solution anyway... Just IMHO. In that case you could change the location mysqld itself uses to be inside the chroot. Or do you actually have a solution? The solution is to use 127.0.0.1 for the connection, as stated previously. Lee
Re: Joomla - MySQL Problem: Could not connect to MySQL
This has also worked for me in the past. Bert On 3/13/10 9:27 AM, L. V. Lammert l...@omnitec.net wrote: On Sat, 13 Mar 2010, Sunnz wrote: 2010/3/12 Daniel Gracia Garallar danie...@electronicagracia.com: Not quite a solution, I think. What about if /var/www mounts in a different filesystem than /var? Hardlinks from chrooted environments don't seem to be a wise solution anyway... Just IMHO. In that case you could change the location mysqld itself uses to be inside the chroot. Or do you actually have a solution? The solution is to use 127.0.0.1 for the connection, as stated previously. Lee
Re: Joomla - MySQL Problem: Could not connect to MySQL
On 2010-03-13, Sunnz sun...@gmail.com wrote: 2010/3/12 Daniel Gracia Garallar danie...@electronicagracia.com: Not quite a solution, I think. What about if /var/www mounts in a different filesystem than /var? Hardlinks from chrooted environments don't seem to be a wise solution anyway... Just IMHO. In that case you could change the location mysqld itself uses to be inside the chroot. yes, this works well. borrowing from the notes in the drupal package; -- -- -- In order to run with standard OpenBSD chroot'ed httpd: - make sure you can connect to your database. Create a directory for the mysql socket. mkdir -p /var/www/var/run/mysql Adjust /etc/my.cnf to put the mysql socket into the chroot. [client] socket = /var/www/var/run/mysql/mysql.sock [mysqld] socket = /var/www/var/run/mysql/mysql.sock -- -- -- if you have an application outside the chroot where you can't set the socket path, you can create /var/run/mysql and create a symlink in that directory pointing at the socket inside /var/www/var/run/mysql..
Re: Joomla - MySQL Problem: Could not connect to MySQL
2010/3/11 Jan malepa...@googlemail.com: I didn't notice, that httpd was still running. kill -TERM ID_of_httpd httpd -u solved the problem. Thank you! Everything works fine! Now that it works we know that it was a problem with chroot. It might be a good practice now to hardlink the mysql.sock in the chroot directory so that you can run apache chrooted... I think you do something like: # mkdir -p /var/www/var/run/mysql # ln -f /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock Then if you shut down httpd and start it again, you shouldn't need -u any more.
Re: Joomla - MySQL Problem: Could not connect to MySQL
Sounds very interesting. But using find / -name mysql.sock isn't successful, so creating a hardlink doesn't work. The directory /var/run/mysql doesn't exist either. Jan Sunnz wrote: 2010/3/11 Jan malepa...@googlemail.com: I didn't notice, that httpd was still running. kill -TERM ID_of_httpd httpd -u solved the problem. Thank you! Everything works fine! Now that it works we know that it was a problem with chroot. It might be a good practice now to hardlink the mysql.sock in the chroot directory so that you can run apache chrooted... I think you do something like: # mkdir -p /var/www/var/run/mysql # ln -f /var/run/mysql/mysql.sock /var/www/var/run/mysql/mysql.sock Then if you shut down httpd and start it again, you shouldn't need -u any more.
Re: Joomla - MySQL Problem: Could not connect to MySQL
Jan wrote: I didn't notice, that httpd was still running. kill -TERM ID_of_httpd httpd -u solved the problem. Thank you! Everything works fine! Well if you're happy running httpd non-chrooted, then fine (seriously). I would not be though. If not, there is more stuff to try in my last reply. Oh, and since misc@ is pretty noisy, I would suggest using reply to all, as at least I don't keep track of every thread I've posted to. I just found this reply by accident. :-) Jan Alexander Hall wrote: Jan wrote: Thank you for the numerous responses! Except the solution to change localhost to 127.0.0.1 in the whole script, I tried everything you Do try that then. I dont know the script at hand, but it cannot be that many places that creates a database connection, can it? IIRC, localhost implies file socket, and even if I'm wrong, it requires a name lookup, and you might be missing /etc stuff in the chroot. proposed. It still doesn't work. Here a short review: === Are you trying to connect to the MySQL socket outside of the httpd chroot? === after having run apachectl start, I tried the same process using httpd -u. But nothing changed. You did mean you killed httpd in between, yes? === mysql -h localhost -u root -p Works perfect. mysql -h localhost -u joomla -p works also. How about mysql -h 127.0.0.1 -P 3306 -u joomla -p ? /Alexander === Have a look in /var/www/logs/ ===in the errorlog of the folder is no entry. access_log shows up: 172.16.172.130 -- [09/Mar/2010:09:47:26 -0700] POST /user01/installation/index.php HTTP/1.1 200 4270 === At the very least you'll also need the php5-mysql-5.2.6.tgz package installed as well. === php5-mysql and php5-mysqli packets are installed both === At the very least you'll also need the php5-mysql-5.2.6.tgz package installed as well. == That's the output of the mysql part in the phpinfo();: mysql MySQL Supportenabled active persistent links0 active links0 client api version5.0.51a mysql_module_typeexternal mysql_socket/var/run/mysql/mysql.sock mysql_include-I/usr/local/include/mysql mysql_libs-L/usr/local/include/mysql directivelocal valuemaster value mysql.allow_persistentOnOn mysql.connect_timeout6060 mysql.default_hostno valueno value mysql.default_passwordno valueno value mysql.default_portno valueno value mysql.default_socketno valueno value mysql.default_userno valueno value mysql.max_linksUnlimitedUnlimited mysql.max_persistentUnlimitedUnlimited mysql.trace_modeOffOff Thank you! Jan
Re: Joomla - MySQL Problem: Could not connect to MySQL
I didn't notice, that httpd was still running. kill -TERM ID_of_httpd httpd -u solved the problem. Thank you! Everything works fine! Jan Alexander Hall wrote: Jan wrote: Thank you for the numerous responses! Except the solution to change localhost to 127.0.0.1 in the whole script, I tried everything you Do try that then. I dont know the script at hand, but it cannot be that many places that creates a database connection, can it? IIRC, localhost implies file socket, and even if I'm wrong, it requires a name lookup, and you might be missing /etc stuff in the chroot. proposed. It still doesn't work. Here a short review: === Are you trying to connect to the MySQL socket outside of the httpd chroot? === after having run apachectl start, I tried the same process using httpd -u. But nothing changed. You did mean you killed httpd in between, yes? === mysql -h localhost -u root -p Works perfect. mysql -h localhost -u joomla -p works also. How about mysql -h 127.0.0.1 -P 3306 -u joomla -p ? /Alexander === Have a look in /var/www/logs/ ===in the errorlog of the folder is no entry. access_log shows up: 172.16.172.130 -- [09/Mar/2010:09:47:26 -0700] POST /user01/installation/index.php HTTP/1.1 200 4270 === At the very least you'll also need the php5-mysql-5.2.6.tgz package installed as well. === php5-mysql and php5-mysqli packets are installed both === At the very least you'll also need the php5-mysql-5.2.6.tgz package installed as well. == That's the output of the mysql part in the phpinfo();: mysql MySQL Supportenabled active persistent links0 active links0 client api version5.0.51a mysql_module_typeexternal mysql_socket/var/run/mysql/mysql.sock mysql_include-I/usr/local/include/mysql mysql_libs-L/usr/local/include/mysql directivelocal valuemaster value mysql.allow_persistentOnOn mysql.connect_timeout6060 mysql.default_hostno valueno value mysql.default_passwordno valueno value mysql.default_portno valueno value mysql.default_socketno valueno value mysql.default_userno valueno value mysql.max_linksUnlimitedUnlimited mysql.max_persistentUnlimitedUnlimited mysql.trace_modeOffOff Thank you! Jan
Re: Joomla - MySQL Problem: Could not connect to MySQL
Jan wrote: Thank you for the numerous responses! Except the solution to change localhost to 127.0.0.1 in the whole script, I tried everything you Do try that then. I dont know the script at hand, but it cannot be that many places that creates a database connection, can it? IIRC, localhost implies file socket, and even if I'm wrong, it requires a name lookup, and you might be missing /etc stuff in the chroot. proposed. It still doesn't work. Here a short review: === Are you trying to connect to the MySQL socket outside of the httpd chroot? === after having run apachectl start, I tried the same process using httpd -u. But nothing changed. You did mean you killed httpd in between, yes? === mysql -h localhost -u root -p Works perfect. mysql -h localhost -u joomla -p works also. How about mysql -h 127.0.0.1 -P 3306 -u joomla -p ? /Alexander === Have a look in /var/www/logs/ ===in the errorlog of the folder is no entry. access_log shows up: 172.16.172.130 -- [09/Mar/2010:09:47:26 -0700] POST /user01/installation/index.php HTTP/1.1 200 4270 === At the very least you'll also need the php5-mysql-5.2.6.tgz package installed as well. === php5-mysql and php5-mysqli packets are installed both === At the very least you'll also need the php5-mysql-5.2.6.tgz package installed as well. == That's the output of the mysql part in the phpinfo();: mysql MySQL Supportenabled active persistent links0 active links0 client api version5.0.51a mysql_module_typeexternal mysql_socket/var/run/mysql/mysql.sock mysql_include-I/usr/local/include/mysql mysql_libs-L/usr/local/include/mysql directivelocal valuemaster value mysql.allow_persistentOnOn mysql.connect_timeout6060 mysql.default_hostno valueno value mysql.default_passwordno valueno value mysql.default_portno valueno value mysql.default_socketno valueno value mysql.default_userno valueno value mysql.max_linksUnlimitedUnlimited mysql.max_persistentUnlimitedUnlimited mysql.trace_modeOffOff Thank you! Jan
Re: Joomla - MySQL Problem: Could not connect to MySQL
Thank you for the numerous responses! Except the solution to change localhost to 127.0.0.1 in the whole script, I tried everything you proposed. It still doesn't work. Here a short review: === Are you trying to connect to the MySQL socket outside of the httpd chroot? === after having run apachectl start, I tried the same process using httpd -u. But nothing changed. === mysql -h localhost -u root -p Works perfect. mysql -h localhost -u joomla -p works also. === Have a look in /var/www/logs/ ===in the errorlog of the folder is no entry. access_log shows up: 172.16.172.130 -- [09/Mar/2010:09:47:26 -0700] POST /user01/installation/index.php HTTP/1.1 200 4270 === At the very least you'll also need the php5-mysql-5.2.6.tgz package installed as well. === php5-mysql and php5-mysqli packets are installed both === At the very least you'll also need the php5-mysql-5.2.6.tgz package installed as well. == That's the output of the mysql part in the phpinfo();: mysql MySQL Supportenabled active persistent links0 active links0 client api version5.0.51a mysql_module_typeexternal mysql_socket/var/run/mysql/mysql.sock mysql_include-I/usr/local/include/mysql mysql_libs-L/usr/local/include/mysql directivelocal valuemaster value mysql.allow_persistentOnOn mysql.connect_timeout6060 mysql.default_hostno valueno value mysql.default_passwordno valueno value mysql.default_portno valueno value mysql.default_socketno valueno value mysql.default_userno valueno value mysql.max_linksUnlimitedUnlimited mysql.max_persistentUnlimitedUnlimited mysql.trace_modeOffOff Thank you! Jan
Joomla - MySQL Problem: Could not connect to MySQL
Hello all together, I installed PHP and MySQL on my box (running apache). When I try to install Joomla, the MySQL Database is recognized by the precheck of the install script. But when I try to connect to the database I get the following error msg: Unable to connect to the database: Could not connect to MySQL I'm a newbie using BSD. I tried really hard, but a simple mistake could be possible. I added the following 3 packets, installed MySQL and set the symbolic links: mysql-server-5.0.51ap1.tgz php5-core-5.2.6.tgz php5-mysqli-5.2.6.tgz I start mysql using the command: /usr/local/bin/mysqld_safe I'm also able open the DB using mysql -u root -p. Any ideas? Jan
Re: Joomla - MySQL Problem: Could not connect to MySQL
Jan wrote: I added the following 3 packets, installed MySQL and set the symbolic links: mysql-server-5.0.51ap1.tgz php5-core-5.2.6.tgz php5-mysqli-5.2.6.tgz Any ideas? Jan At the very least you'll also need the php5-mysql-5.2.6.tgz package installed as well. It contains the base mysql stuff, mysqli is additional to the base. Try that and see how it goes. -- -RSM http://www.erratic.ca
Re: Joomla - MySQL Problem: Could not connect to MySQL
On Mon, Mar 8, 2010 at 10:07 PM, Jan malepa...@googlemail.com wrote: Any ideas? Are you trying to connect to the MySQL socket outside of the httpd chroot? Floor -- Floor Terra flo...@gmail.com www: http://brobding.mine.nu/
Re: Joomla - MySQL Problem: Could not connect to MySQL
On 8 Mar 2010, at 21:07, Jan wrote: Unable to connect to the database: Could not connect to MySQL Check that your code is connecting to 127.0.0.1 instead of localhost? Usually fixes it for me and you don't need to worry messing around with sockets. G. -- Bought to you by the Department of Redundancy Department's Recursion Division of Recursion http://playr.co.uk/
Re: Joomla - MySQL Problem: Could not connect to MySQL
On Mon, 8 Mar 2010, Jan wrote: Unable to connect to the database: Could not connect to MySQL 1) Create a simple phpinfo() page check to see that your MySQL is configured properly. Did you install php-mysql? 2) I'm also able open the DB using mysql -u root -p. The only valid test is with the UID PW that you created for Joomla - you did create it, didn't you? Lee
Re: Joomla - MySQL Problem: Could not connect to MySQL
On Mon, Mar 8, 2010 at 9:07 PM, Jan malepa...@googlemail.com wrote: Hello all together, I installed PHP and MySQL on my box (running apache). When I try to install Joomla, the MySQL Database is recognized by the precheck of the install script. But when I try to connect to the database I get the following error msg: Unable to connect to the database: Could not connect to MySQL I'm a newbie using BSD. I tried really hard, but a simple mistake could be possible. I added the following 3 packets, installed MySQL and set the symbolic links: mysql-server-5.0.51ap1.tgz php5-core-5.2.6.tgz php5-mysqli-5.2.6.tgz I start mysql using the command: /usr/local/bin/mysqld_safe I'm also able open the DB using mysql -u root -p. What happens when you try: mysql -h localhost -u root -p But as the error messages says - Joomla cannot connect to your database (mysql). Have a look in /var/www/logs/ especially the error logs and also in the error logs for mysql - they should help resolve this issue. hth Fred