Note that there are some explanatory texts on larger screens.

plurals
  1. POMacPorts: MySQL and PHP doesn't connect
    text
    copied!<p>I've looked through related posts and their suggested solutions (<a href="https://stackoverflow.com/questions/5353954/">here</a> and <a href="https://stackoverflow.com/questions/1516739/">here</a>) but they don't seem to help in my situation.</p> <p>I'm running MacPorts 2.1.2 on Snow Leopard, and I've got the following packages installed:</p> <pre><code>php5-mysql @5.3.15_0+mysql5 (active) php5 @5.3.15_0+apache2 (active) mysql5 @5.1.63_0 (active) mysql_select @0.1.2_0 (active) apache2 @2.2.22_2+preforkmpm (active) </code></pre> <p>I can point my web browser at localhost and it will connect to the default site; a test index.php</p> <pre><code>&lt;?php phpinfo() ?&gt; </code></pre> <p>page works fine as well, so I assume at this point that PHP is functional. The problem is connecting to the installed MySQL server. Neither phpmyadmin nor Joomla can seem to connect, and trying a .php test script resulted in problems too. I'm a bit at loss as to how to proceed from here.</p> <p>The MySQL server is apparently running:</p> <pre><code>~ &gt; ps ax | grep mysql 10884 ?? S 0:00.03 /bin/sh /opt/local/lib/mysql5/bin/mysqld_safe 10930 ?? S 0:07.66 /opt/local/libexec/mysqld --basedir=/opt/local --datadir=/opt/local/var/db/mysql5 --user=_mysql --log-error=/opt/local/var/db/mysql5/tigger.local.err --pid-file=/opt/local/var/db/mysql5/tigger.local.pid </code></pre> <p>and I am able to use the mysql client:</p> <pre><code>~ &gt; mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 15 Server version: 5.1.63 Source distribution mysql&gt; show databases; +--------------------+ | Database | +--------------------+ | information_schema | | test | +--------------------+ 2 rows in set (0.04 sec) mysql&gt; show grants for 'root'@'localhost'; +---------------------------------------------------------------------+ | Grants for root@localhost | +---------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION | +---------------------------------------------------------------------+ 1 row in set (0.00 sec) </code></pre> <p>There's the socket</p> <pre><code>~ &gt; ll /opt/local/var/run/mysql5/mysqld.sock srwxrwxrwx 1 _mysql admin 0 Jul 31 16:55 /opt/local/var/run/mysql5/mysqld.sock </code></pre> <p>and the php.ini contains the MySQL module and configuration</p> <pre><code>~ &gt; /opt/local/bin/php -i | grep mysql | grep socket mysql.default_socket =&gt; /opt/local/var/run/mysql5/mysqld.sock =&gt; /opt/local/var/run/mysql5/mysqld.sock mysqli.default_socket =&gt; no value =&gt; no value pdo_mysql.default_socket =&gt; /opt/local/var/run/mysql5/mysqld.sock =&gt; /opt/local/var/run/mysql5/mysqld.sock </code></pre> <p>It all seems to me as this is how things should be. However, when I try to log into phpmyadmin using 'root' the connection fails, and the same happens during Joomla setup.</p> <p>Any help, hints, suggestions are appreciated :-)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload