Thread: Newbie Help

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0

    Newbie Help


    I created a shortcut so that I can just type 'mysql' from bash to enter but it doesn't show the same databases as when I use the sudo mysql -u root -p command.

    Code:
    $ sudo mysql -u root -p
    Password:
    Enter password: 
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 15
    Server version: 5.6.11 MySQL Community Server (GPL)
    
    Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | coding             |
    | mysql              |
    | performance_schema |
    | test               |
    | testaccess         |
    +--------------------+
    6 rows in set (0.00 sec)
    
    mysql> exit;
    Bye
    $ mysql
    Welcome to the MySQL monitor.  Commands end with ; or \g.
    Your MySQL connection id is 16
    Server version: 5.6.11 MySQL Community Server (GPL)
    
    Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
    
    Oracle is a registered trademark of Oracle Corporation and/or its
    affiliates. Other names may be trademarks of their respective
    owners.
    
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    
    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | test               |
    +--------------------+
    2 rows in set (0.00 sec)
    
    mysql>
    It's almost as if the shortcut is loading a brand new mysql as all it shows is the "stock" databases. Is there any way to sync the two together?

    I'm using Mac OSX 10.7.5.
  2. #2
  3. Did you steal it?
    Devshed Supreme Being (6500+ posts)

    Join Date
    Mar 2007
    Location
    Washington, USA
    Posts
    13,965
    Rep Power
    9397
    Whatever user your mysql shortcut connects as does not have permission to use those additional databases. They are still there, you just can't see them.
  4. #3
  5. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,578
    Rep Power
    1906
    Are you sure it has logged in correctly?
    How have you created the shortcut?
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    2
    Rep Power
    0
    Originally Posted by MrFujin
    Are you sure it has logged in correctly?
    How have you created the shortcut?
    I think I ran this:

    Code:
    echo 'export PATH=/usr/local/mysql/bin:$PATH' >> ~/.bash_profile
    . ~/.bash_profile
    I'm following an online course on Udemy so I inputted a number of commands. Is there a way to start over completely from scratch?

IMN logo majestic logo threadwatch logo seochat tools logo