[MacPorts] #24956: Having trouble installing mysql
#24956: Having trouble installing mysql --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: High | Milestone: Component: ports | Version: 1.8.2 Keywords: | Port: mysql --------------------------+------------------------------------------------- Hi: I have started the process of installing MAMP as per the instructions on the MacPorts wiki howto for MAMP on http://trac.macports.org/wiki/howto/MAMP I had no problems through the beginning of Step 3: Install MySQL. The port install worked seamlessly. However, setting up the database was very silent (no feedback what so ever). The autostart seems to work, and grep filtering for mysql processes seems to indicate mysql is running no problem. But when I try to set the root password, I get the following error. mysqladmin5: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/opt/local/var/run/mysql5/mysqld.sock' exists! Likewise, when I try to log into the server, it says: Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2) I am running Mac OS X 10.6.3 2.4 GHz Intel Core 2 Duo 3 GB Ram Not sure how to proceed. -- Ticket URL: <http://trac.macports.org/ticket/24956> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble installing mysql --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: High | Milestone: Component: ports | Version: 1.8.2 Keywords: | Port: mysql --------------------------+------------------------------------------------- Comment(by samii@…): OK, well, I resolved that problem. I had to kill the mysql processes that were active and start them up again. Now, I tried installing php5 following the same instructions. No errors reported, but when I try to load phpinfo.php, it doesn't work. It just loads the document as a text file in the browser window. -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble installing mysql --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Changes (by jmr@…): * priority: High => Normal * cc: samii@… (removed) * version: 1.8.2 => * component: ports => wiki * port: mysql => php5 -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble installing mysql --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Changes (by ryandesign@…): * cc: ryandesign@… (added) Old description:
Hi:
I have started the process of installing MAMP as per the instructions on the MacPorts wiki howto for MAMP on http://trac.macports.org/wiki/howto/MAMP
I had no problems through the beginning of Step 3: Install MySQL. The port install worked seamlessly.
However, setting up the database was very silent (no feedback what so ever).
The autostart seems to work, and grep filtering for mysql processes seems to indicate mysql is running no problem.
But when I try to set the root password, I get the following error.
mysqladmin5: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/opt/local/var/run/mysql5/mysqld.sock' exists!
Likewise, when I try to log into the server, it says:
Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)
I am running Mac OS X 10.6.3 2.4 GHz Intel Core 2 Duo 3 GB Ram
Not sure how to proceed.
New description: Hi: I have started the process of installing MAMP as per the instructions on the MacPorts wiki howto for MAMP on [wiki:howto/MAMP howto/MAMP] I had no problems through the beginning of Step 3: Install MySQL. The port install worked seamlessly. However, setting up the database was very silent (no feedback what so ever). The autostart seems to work, and grep filtering for mysql processes seems to indicate mysql is running no problem. But when I try to set the root password, I get the following error. {{{ mysqladmin5: connect to server at 'localhost' failed error: 'Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/opt/local/var/run/mysql5/mysqld.sock' exists! }}} Likewise, when I try to log into the server, it says: {{{ Can't connect to local MySQL server through socket '/opt/local/var/run/mysql5/mysqld.sock' (2) }}} I am running Mac OS X 10.6.3 [[br]] 2.4 GHz Intel Core 2 Duo [[br]] 3 GB Ram Not sure how to proceed. -- Comment: Then that's a separate issue. Have you added this line to your httpd.conf and restarted Apache? {{{ Include conf/extra/mod_php.conf }}} -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble installing mysql --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by samii@…): Yes, I added it as the last line of httpd.conf -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:5> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by ryandesign@…): And you've run {{{ cd /opt/local/apache2/modules sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so }}} and verified that {{{ LoadModule php5_module modules/libphp5.so }}} appears in the httpd.conf up where the other LoadModule directives are? -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by samii@…): Yes, in both cases -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by ryandesign@…): Then this doesn't make sense. Can you attach your httpd.conf and phpinfo.php? -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by samii@…): FYI, when I ran the above command, I received the following message, which to me indicates that PHO is now active within apache2 $ sudo /opt/local/apache2/bin/apxs -a -e -n "php5" libphp5.so Password: [activating module `php5' in /opt/local/apache2/conf/httpd.conf] -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by ryandesign@…): The httpd.conf you attached looks a lot like /etc/apache2/httpd.conf. That's the configuration file for Apple's Apache server included with Mac OS X. When using the MacPorts php5 port, you're going to be using the MacPorts apache2 provided in the apache2 port, whose configuration file is at /opt/local/apache2/conf/httpd.conf. That's the file you'll be editing. -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by samii@…): Should I consider completely uninstalling MacPorts and all ports that are installed and starting fresh? If so, what is the best installation strategy to employ? -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by ryandesign@…): I don't know why that would help, but I also don't know what else to suggest. Well, I suggest you write to the [http://lists.macosforge.org/mailman/listinfo.cgi/macports-users macports- users mailing list]; that will be read by a lot more people than comments in a ticket and maybe someone else has suggestions. If you want to [http://guide.macports.org/chunked/installing.macports.uninstalling.html uninstall MacPorts], instructions are in the Guide. -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by samii@…): Well, I've uninstalled everything and right now, I am in the process of reinstalling. mysql5-server is installing now. I am following the howto here on MacPorts. Just to be sure, because I believe that my errors result from my last attempted install. Once mysql5-server is installed, I need to set up the main database and then start mysql5-server. There are two ways of setting up the main database as per the howto. Which would you recommend? Likewise, I believe I had problems with setting the password last time. What output should I expect when I set up the password, and what should be a red flag that something is broken? Also, should I run the optional security configuration? -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:13> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by samii@…): OK, went through all the steps as defined in the howto. Now, instead of the phpinfo.php file showing up as text echoed on screen, it downloads as a downloadable file. What do I need to edit or change? I am attaching the new phpinfo.php and newly generated httpd.conf files here. -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:14> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by ryandesign@…): The only difference between the two httpd.conf files you posted is the DirectoryIndex line which wouldn't account for this difference in behavior you observed. Please write to the macports-users mailing list for help. There are many people there using PHP and MySQL successfully in MacPorts; maybe one of them can walk through the setup with you. -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:15> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by info@…): Replying to [comment:14 samii@…]:
Now, instead of the phpinfo.php file showing up as text echoed on screen, it downloads as a downloadable file.
Here's a shot in the (not so) dark. Sounds like apache isn't associating the '.php' extension with the php engine. I see your httpd.conf has the include line: {{{ Include conf/extra/mod_php.conf }}} Make sure that this file exists (full path: ''/opt/local/apache2/conf/extra/mod_php.conf''), that it's readable by whatever user (on your local box, you can make it readable by everyone), and that it has these lines: {{{ <IfModule mod_php5.c> AddType application/x-httpd-php .php AddType application/x-httpd-php-source .phps </IfModule> }}} (as always, restart apache after any changes) If this doesn't fix it, turn on apache error logging and check for errors. -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:16> MacPorts <http://www.macports.org/> Ports system for Mac OS
#24956: Having trouble using mysql5 and php5 --------------------------+------------------------------------------------- Reporter: samii@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: wiki | Version: Keywords: | Port: php5 --------------------------+------------------------------------------------- Comment(by info@…): Replying to [comment:14 samii@…]: You might also try a full path to the ''mod_php.conf'' file. That's what's working for me, though I didn't test with a relative path. -- Ticket URL: <http://trac.macports.org/ticket/24956#comment:17> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts