SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't start MySQL command line

    I'm trying to get through the Lenz book and can't start the MySQL command Line

    I followed the instructions in chapter 2
    --------
    dave-halletts-computer-2:/usr/local/mysql/bin davehallett$ sudo /usr/local/mysql/bin/mysqld_safe
    Starting mysqld daemon with databases from /usr/local/mysql/data
    ^Z
    [1]+ Stopped sudo /usr/local/mysql/bin/mysqld_safe
    dave-halletts-computer-2:/usr/local/mysql/bin davehallett$ bg
    [1]+ sudo /usr/local/mysql/bin/mysqld_safe &
    dave-halletts-computer-2:/usr/local/mysql/bin davehallett$ ps -ax | grep mysql
    607 p1 S 0:00.03 /bin/sh /usr/local/mysql/bin/mysqld_safe
    620 p1 S 0:00.17 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/data -
    622 p1 S+ 0:00.00 grep mysql
    dave-halletts-computer-2:/usr/local/mysql/bin davehallett$ mysql
    -bash: mysql: command not found
    dave-halletts-computer-2:/usr/local/mysql/bin davehallett$ mysql5
    -bash: mysql5: command not found
    dave-halletts-computer-2:/usr/local/mysql/bin davehallett$ mysql -u root
    -bash: mysql: command not found

    --------
    I've tried a number of things but can't launch the console so I can't create the databases as described in Chapter 4

    When I "ls" in the /usr/local/mysql/bin directory the mysql command is listed.

    I'm stuck at this stage - can anyone help?

    Thanks
    Dave

  2. #2
    SitePoint Wizard HarryR's Avatar
    Join Date
    Dec 2004
    Location
    London, UK
    Posts
    1,376
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    the "/usr/local/mysql/bin" directory is not in your PATH environment variable, you can run the MySQL commandline client using one of the following:

    Code:
    # export PATH=$PATH:/usr/local/mysql/bin
    # mysql
    or
    Code:
    # /usr/local/mysql/bin/mysql

  3. #3
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i had the same problem. ive installed the latest build of Mysql version 5 and latest stable version of ruby and gem.

    In order for me to access my mysql console, use the following command

    /usr/local/mysql/bin/mysql -u root -p

    It will ask you for a password. Note, I did not have a password on the root account so i pressed the enter button on my keyboard.

    If you do have a password on the root account and you are not sure what it is, you can reset it by the following command:

    /usr/local/mysql/bin/mysqladmin -u root password yourpasswordhere

    EXAMPLE:

    set root account password is hello, use the following command:
    /usr/local/mysql/bin/mysqladmin -u root password hello



    hope it helps. harry
    Last edited by harrybauer; Jul 10, 2007 at 10:25.

  4. #4
    SitePoint Member
    Join Date
    Jul 2007
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks - got it working


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
  •