How can I set up a basic MySQL server?

Discussion in 'Web Design and Development' started by jamescw4406, Nov 22, 2006.

  1. jamescw4406 macrumors newbie

    Joined:
    Oct 25, 2006
    Location:
    SE Arizona
    #1
    What I want to do is set up a MySQL server on my Intel iMac and create and manage databases on the same machine using a GUI front end, such as Cocoa. I downloaded and the installed the latest MySQL and PHP, neither shows up under applications. I can start or stop the MySQL server from the command shell, but I can't link to the server, in fact can't do anything else in MySQL. I'm not quite ready for web development. How do I remove PHP and configure MySQL to work locally, set passwords, figure out how to link to the local host, etc.

    When I try to connect as root with no password, as instructed in the README file that came with the installation software, I get the following error:
    MySQL said: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)

    Any advice would be greatly appreciated.
     
  2. Apple2Mac macrumors regular

    Apple2Mac

    Joined:
    Sep 3, 2006
    #2
  3. nightelf macrumors 6502

    Joined:
    Mar 25, 2003
    #3
    If you got the MySQL installer from MySQL.com, you will find a System Preferences item (MySQL.prefPane) in the .dmg. Just drag this to your "PreferencesPanes" in the main Library folder. This will let you turn on and off the server.

    MySQL also have a package that will turn on the server on restart, this is also found in the .dmg.

    You can download some administrative apps for MySQL at http://dev.mysql.com/downloads/gui-tools/5.0.html. You can create users, set passwords, view logs, backup dbs, etc with these apps.

    To fix the socket problem you need to modify the php.ini, and tell PHP to check the socket in the right place, not the old one.

    http://docs.info.apple.com/article.html?artnum=302977
     
  4. xoreu macrumors member

    Joined:
    Nov 12, 2006
    #4
    If this is for testing and/or development, I'd recommend you try xampp. What it is is Apache, MySQL, and PHP wrapped together in a basic package. It also includes phpmyadmin, which is a great tool for managing MySQL databases. Best of all, there's almost no setup and configuration required.

    Personally, I used it a lot for development on Windows, so I can't vouch for the Mac version, but I would guess it is as easy and helpful.

    However, if you're planning to be using the MySQL databases for hosting a site (or something else that will give the public access to them), you probably shouldn't use xampp, as it isn't very secure.
     

Share This Page