SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Member
    Join Date
    May 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question SQL Mac OS X Installatiion Help

    I'm following the book 'Build Your Own Database Driven Website Using PHP & MYSQL' 3rd edition, written and distributed by SitePoint.

    On page 20, he mentions putting a password file into the 'data' folder. However, my OS tells me I can't enter into the actual folder, because my login doesn't have the proper permissions. I'm the admin on my mac, and don't understand why I can't get in.

    Any ideas?

    Thanks in advance!

  2. #2
    SitePoint Member
    Join Date
    May 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Mac OS SQL Installation Help

    I am attempting to follow the installation instructions of Sitepoint's "Build Your Own Database Driven Website Using PHP & MYSQL", 3rd edition. I have a Mac OS, have downloaded and installed the MySQL software. If you also have the book, I'm on page 20.

    After installing the software, on page 20, I have to create a text file and place it into the /usr/local/mysql/data folder.

    However, when I try to place the file into that folder, I get a prompt that says I don't have access permissions to open the folder.

    I am the owner and admin of my computer, so I don't understand why I can't access the folder. I really want to continue the training, but can't move forward until I get the installation finished.

    Does anyone out there have any ideas?

  3. #3
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you installed mySql from mySql.com on your make using the .dmg file and installed the mySql gui tools as well. when you start them up it give you the option to connect to local host. but the user and password are blank.

    if you have not set a password it should connect to the local mysql server but if you did not put root in the username field you will not have any permissions assigned to you.

    so you should be able to connect to local host with the mysql gui tools using user name root and leaving the password blank and then create a new user acount with admin permissions and relogin using that account.

    also you should add a password to your root user, as none is assigned by default.

    hope this helps

  4. #4
    SitePoint Member
    Join Date
    May 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The files I installed were to install the server, and also to start the software on startup of the machine.

    I never got the option to enter in any passwords, and I don't see any gui tools to access. The only way I know the server is running, is by looking at the MySQL preference pane under the system prefs. It tells me the server is running, and that it runs at startup.

    After that, I'm in the dark. No login fields, no password fields, just a machine that tells me I can't access a folder though I'm logged in as the admin.

    As I read your response about the root, where and how do I log in? Do I log into the mac a different way, or do I log into the server somehow?

  5. #5
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok, well you can do everything from the command line via the terminal on your mac, or and i suggest while learning grab the gui tools from mysql's web site.

    once you download them, install both the mysql admin and the mysql query browser.

    actually under the coldfusion 8 training videos on lynda.com they have installation videos available. you don';t have to sign up, just scroll down to the databases part of the link here and watch the mysql installation videos for mac os x, i'm postitive they are free, including the mysql gui tools installation guide.

    after both of those are installed you should be able to open both and connect to your server using localhost for the address and root for the password. then you can adjust things as i wrote in the previous reply.

    hope this helps

  6. #6
    SitePoint Member
    Join Date
    May 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question

    Those GUI tools are great! A veil of confusion has lifted, but the original problem still exists.

    Here's what the book wants me to do. Perhaps there's a better way?

    "After the basic installation is complete, you must configure MySQL to use a PHP-compatible password format. To do this:

    1. Create text file
    2. Type
    [mysqld]
    old-passwords
    3. Save as 'my.cnf'
    4. At the top of the window, choose GO>GO TO FOLDER, and type /usr/local/mysql/data/ as the destination.
    5. Drag the file from the desktop to the folder. When prompted, choose AUTHENTICATE and enter your credentials.
    6. Restart your computer."

    It is at the forth step, that I fail. The data folder is still locked out, even though I've now been able to do as you say and log into the server as 'localhost' using the 'root' login. I can't drag the file into the folder, because for some reason, I'm locked out.

    My question: If I can't get into the folder, is there another way to make it work?

  7. #7
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mac is built on unix, which has a lot of files and directories, many more than are listed in the gui. if you notice when you open you computer in the finder you will not see any folder named usr, even though on exists.

    now i'm no mac expert, that said i don;t know of a way to access those directories/files in the gui.

    so i suggest using the teminal. now if you are not comfortable or have not used the terminal before please be careful as you could easily mess up your computer.

    with that bit of caution you can easily do what the book asks you with the following.

    first in your finder go to applications->utilities->terminal

    that will launch the terminal, now you need to go to those that directory but by default it wont allow you to, so you need to use the sudo command. this command is powerful (this is the part to use caution). the sudo allows you to access the system as root which basically means you can do anything, including mess anything up.

    each time to preceed a command with the word sudo it will ask you for a password, that password is the admin password you entered when you installed the os, basically it should be your admin users password, the same one you enter when you install software.

    so enter the following in the terminal:

    sudo cd /usr/local/mysql/data/

    then you need to create and edit that file, you can do this with the following:

    sudo pico my.cnf

    that will open a blank editor screen for pico, you can google it if you want to know more but add a few lines is simple.

    simply type in the lines it asks you to. then press the "ctrl" key with the "x" key. answer yes to the questions, i think a simple "y" will work. and the editor should close and now you have your my.cnf file in place.

    the rest should work as the book suggests.

  8. #8
    SitePoint Member
    Join Date
    May 2008
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Smile

    I feel like I'm getting closer!

    The book asks me to set a password for 'root'. In the terminal window I type:

    cd usr/local/mysql/bin (This is where the 'mysql' program appears to me to be)

    mysql -u root mysql

    I get this response:

    "-bash: mysql: command not found"

    Am I getting closer?
    Last edited by jblunda; May 7, 2008 at 06:33.

  9. #9
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    that should be where it is correct, however you many need to adjust the permisions with

    chmod 775 -R /usr/local/mysql

    also you can try running the mysql command with sudo in front of it.

    also you may want to adjust your path, so the terminal can find the mysql command

    you can do:
    sudo pico ~/.bash_login

    then find this line and add the mysql parts to the end of it.
    export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH"

    once again becarefull, and don't forget to save your changes.

  10. #10
    SitePoint Enthusiast
    Join Date
    May 2008
    Posts
    43
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you might also check out this hive logic walk through.


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
  •