Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Posts
    24
    Plugin Contributions
    0

    Default I have MySQL working and Zen Cart as well finally

    Well the saga seems to be over for now. Finally I can explore Zen Cart again.

    Here is the problem I found out with MySQL and OS X 10.4.8 (actually 10.4.4 and higher is affected by the first note). See the below documentation from Apple. These settings were the source of a lot of my problems. I include the comments on how it worked at 10.4 because it contained some useful information in my working things out. But the comments in 10.4.4 info below turned out to be true and once I set up the files properly MySQL worked fine. And I could go back to reinstalling Zen Cart and it works fine.

    Mac OS X Server 10.4.4: Improvements to Apache/PHP/MySQL interaction
    Mac OS X Server 10.4.4 resolves two issues with the default interaction between the versions of PHP and MySQL that are pre-installed on Mac OS X Server:

    PHP's MySQL client libraries are updated so that it recognizes the more secure authentication mechanism available in recent versions of MySQL. Therefore it's no longer necessary to start MySQL with the --old-passwords option or force MySQL passwords to the old format, though old format passwords will still be recognized.
    The default socket location for PHP and MySQL is now the same (/var/mysql/mysql.sock). If you modified your MySQL configuration to revert to using /tmp/mysql.sock, the update process will detect that condition and create a symlink in /var/mysql so that the socket can be accessed by PHP. This is done to prevent disruption, and should be considered a temporary measure. At your earliest convenience, you should remove any socket directives from the [mysqld] and [client] sections of your MySQL config files, and allow MySQL to use its default socket location. Then you can restart MySQL; it will remove the symlink from /var/mysql, replace it with the socket, and PHP will continue to have access.
    In addition, to remove a barrier to seamless interaction with the Apache web server:

    The MySQL Manager application now creates the /var/mysql directory (which contains the MySQL socket) with permissions that allow the web server to access it.
    If that directory already exists, the update process sets the correct permissions.
    For self-installed MySQL

    If you have downloaded and installed MySQL yourself but are using the pre-installed version of PHP, note that your custom version of MySQL might be configured to use the old MySQL socket location, /tmp/mysql.sock. The version of PHP in this software update uses the newer location /var/mysql/mysql.sock by default.

    Therefore, if your PHP scripts are failing to connect to your custom installation of MySQL, this is a likely cause. To correct this, you can modify the PHP configuration file to use the old MySQL socket location:

    Create /etc/php.ini if it is not present. (You can do so by copying /etc/php.ini.default to /etc/php.ini).
    Edit the /etc/phi.ini config file, find the [MySQL] section, and change this line:
    mysql.default_socket = /var/mysql/mysql.sock
    To:
    mysql.default_socket = /tmp/mysql.sock
    Restart the web server to pick up the new PHP settings. It should not be necessary to restart MySQL.
    If you subsequently decide to use the version of MySQL that is pre-installed with Mac OS X Server, which uses /var/mysql/mysql.sock, you'll want to either remove that line from /etc/php.ini, or change it back.


    Mac OS X Server 10.4: Issues connecting PHP to MySQL
    When running MySQL and PHP on the same Mac OS X 10.4 server, you may find that PHP cannot connect to MySQL. When PHP is communicating with a MySQL server on the same host, it uses a socket file to communicate, and looks for it at /tmp/mysql.sock. On Mac OS X Server 10.4, MySQL creates this socket file at /var/mysql/mysql.sock.

    To resolve this issue, you can either change the location where MySQL creates its socket file, or modify the location where PHP looks for the file. Please note that the first option is less secure than the second. Before delving in, you should also review new information relevant to PHP and MySQL on Mac OS X Server 10.4.4 and later.

    To change the location where MySQL creates its socket file, do this:

    Open your preferred text editor and create a plain text file.
    Type this text (on two lines as shown):

    [mysqld]
    socket=/tmp/mysql.sock

    Save the file as: /etc/my.cnf
    To change the location where PHP looks for the socket file, follow these steps:

    In Terminal: sudo cp /etc/php.ini.default /etc/php.ini
    Open /etc/php.ini in your preferred text editor.
    Find the [MySQL] section, and change the mysql.default_socket directive:
    ; Default socket name for local MySQL connects. If empty, uses
    the built-in
    ; MySQL defaults.
    mysql.default_socket = /var/mysql/mysql.sock

    Change the permissions on /var/mysql so that www can read the socket, by executing this in Terminal:

    sudo chmod 775 /var/mysql
    One of the problems I seemed to have with the confusion as to where PHP and MySQL were finding the default socket (/var/myslq/ vs /tmp/mysql.sock) was that ports seemed weird. My localhost was getting assigned to 9000 port and yet the *.err log file showed that MySQL was running at 3306.

    While things seem fine I notice that MySQL seems to be at localhost:3306, but in Zen Cart Admin Version info under tools it reports the the address was at localhost:80. I guess I am not sure what all is going on here and the 80 is where Zen Cart works and the 3306 port is where MySQL resides?

    But all is working. Maybe this info will be of help to other mac users who can avoid these last couple interesting but long days as I closed in on what was going on.

    Russ Jacobson

  2. #2

    Default Re: I have MySQL working and Zen Cart as well finally

    Very very thanks this info, I just need this, good man, Thanks.

 

 

Similar Threads

  1. 'add to cart' button not working well
    By george_usa in forum General Questions
    Replies: 1
    Last Post: 2 Dec 2010, 07:11 AM
  2. MySQL 5 and Zen Cart 1.3.8a?
    By HugATree in forum General Questions
    Replies: 1
    Last Post: 1 Apr 2010, 09:03 PM
  3. new to zen, purchased a zen template, going well but have hit a brick wall. HELP...
    By Inkwork in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 26 Jan 2008, 05:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR