MySql, Leopard and terminal - MySql -u root -p

Discussion in 'Web Design and Development' started by majorp, Dec 16, 2007.

  1. majorp macrumors 6502

    Joined:
    Nov 28, 2005
    Location:
    UK !!!
    #1
    I have installed mysql on leopard succesfully (i think)

    Through CocoaMySql I can connect via root@localhost with no password, create databases etc.

    But..... I can't connect through terminal.

    when I enter:

    >mysql -u root -p

    -bash: mysql: command not found

    even when i use the full path /usr/local/mysql still the same error.

    It's as if the link hasn't been created for mysql?

    This is on a fresh install of leopard with nothing else installed.

    Any help appreciated.
     
  2. stomer macrumors 6502a

    Joined:
    Apr 2, 2007
    Location:
    Leeds, UK
    #2
    You may have installed the mysql server but not the client. To find out for sure just run:

    $ sudo find / -name 'mysql' -print

    If you do have the mysql client installed, then the above command will (eventually) tell you where it is.
     
  3. sord macrumors 6502

    Joined:
    Jun 16, 2004
    #3
    Its /usr/local/mysql/bin/mysql, not just /usr/local/mysql

    You may want to add it's bin to your PATH too (create/edit your ~/.bash_profile and put:
    Code:
    export PATH="$PATH:/usr/local/mysql/bin"
    in it)
     
  4. majorp thread starter macrumors 6502

    Joined:
    Nov 28, 2005
    Location:
    UK !!!
    #4
    thanks to you both. seems to be working now :rolleyes:

    user error...
     
  5. dni777 macrumors newbie

    Joined:
    Jan 10, 2008
    #5
    Which version of mySQL for Leopard?

    Which version of mySQL will be best for Leopard?
     
  6. stomer macrumors 6502a

    Joined:
    Apr 2, 2007
    Location:
    Leeds, UK
    #6
    I don't think it's a question of what's best for Leopard, as both 4 and 5 will run fine on Leopard, it's more a question of what features you require.

    I don't see any reason to run 4 over 5, as version 5 is now stable enough for a production environment and also has a lot more features.
    There may be features that you require that are only available in 5.1 and/or 6. Then you need to decide if it's worth running a db that might have stability problems.
     
  7. abcNoob macrumors newbie

    Joined:
    Sep 13, 2008
    #7
    If you log in as Root without a password, you do not type:
    mysql -uroot -p

    You instead should type:
    mysql -uroot

    I hope it helps :)
     
  8. matttheaviator macrumors newbie

    Joined:
    Oct 2, 2008
    #8
    .bash_profile problem

    Hi Im using the same setup and have tried to find the .bash_profile file but cant so i tried to create it like the install docs said and it said to save it my home. Is the exact path macHDD/users/myaccount/.bash_profile

    also I cant get the mysql databse to start up once i initialised it for the first time

    Any ideas

    very frustrated.

    Thanks for any help with this problem(s)

    matt
     
  9. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #9
    Correct on the path. You can also access Home by doing ~/ So you could edit the bash profile by doing:
    Code:
    pico ~/.bash_profile
    What program are you using to edit the profile?

    As far as the MySQL, what commands are you trying?
     
  10. harmander macrumors newbie

    Joined:
    Sep 5, 2011
    #10
    great help..

    Its /usr/local/mysql/bin/mysql, not just /usr/local/mysql

    You may want to add it's bin to your PATH too (create/edit your ~/.bash_profile and put:
    Code:
    export PATH="$PATH:/usr/local/mysql/bin"



    thanks allooottt:):):):)
     

Share This Page