SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Los Angeles CA
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't connect to MySQL via termainal window

    I need some help connecting to MySQL through the terminal window. I need to know the code and from what directory to enter it.

    I am using OSX 10.3, I have installed MySQL correctly on my local computer and the Apache server is running. I can establish a connection through a test php page that I made, but I need to connect via the command prompt to make sense of Kevin's latest book "Build Your Own DB Driven Website Using PHP & MySQL". The code and information on page 32 is either wrong or not complete enough to work as written.

    Here is are a couple of things I've tried, among many many others:

    Last login: Sat Jan 15 23:34:09 on ttyp1
    Welcome to Darwin!
    [67-23-43-124:~] russ% mysql -u root -p
    tcsh: mysql: Command not found.
    [67-23-43-124:~] russ% cd /usr/local/mysql/bin
    [67-23-43-124:local/mysql/bin] russ% mysql -u root -p
    tcsh: mysql: Command not found.
    [67-23-43-124:local/mysql/bin] russ%

    Any help would be appreciated. Thanks.

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    Abilene, TX
    Posts
    92
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This code is assuming that mySQL is installed on your machine at /usr/local/mysql. You may want to verify that is the correct running location. The reason why is because depending on which mySQL you install (either from mySQL's website, from Server Logistics, or on OS X Server preinstalled). To check, you can type in"

    Code:
    [67-23-43-124:~] russ% ps ax | grep mysql
    This should tell you where mySQL is running. Then run the following:

    Code:
    [67-23-43-124:~] russ% cd /usr/local/mysql/bin
    Then:

    Code:
    [67-23-43-124:local/mysql/bin] russ% ./mysql -uroot -p
    Reg

    "I don't care how many beers you've had...
    Get your chickens out of my lawn!"

  3. #3
    SitePoint Member
    Join Date
    Jan 2005
    Location
    Los Angeles CA
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you so much Reg! My gawd it works! It really works! I feel better now.


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
  •