Results 1 to 6 of 6

Thread: Problem with using mysql

Hybrid View

  1. #1
    Join Date
    Oct 2007
    Beans
    41

    Question Problem with using mysql

    I recently installed mysql using the following url:
    http://www.howtogeek.com/howto/ubunt...r-5-on-ubuntu/

    And I simply used the following commands:
    sudo apt-get install mysql-server
    sudo apt-get install php5-mysql

    I used the official mysql tutorials to try to figure out how to start using it, but I simply don't know how to start using it.
    I used to following url to get me started.
    http://dev.mysql.com/doc/refman/5.0/...onnecting.html

    It gives me the command
    mysql -h host -u user -p

    My problem is, I have installed mysql on my own Ubuntu computer, but I can't figure out for life of me, what my hostname is. I have tried my user name which is root, and many other combinations.

    I know the SQL language, I just need to know how to actually use mysql on my own computer, and how to log into it. Any and all help is appreciated.

    Thank You


  2. #2
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: Problem with using mysql

    Hostname???

    Um, user@hostname.
    Or, type:
    Code:
    hostname
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  3. #3
    Join Date
    Aug 2007
    Location
    127.0.0.1
    Beans
    1,800
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Problem with using mysql

    user: root
    password: the one you set up on the install.
    host: localhost or 127.0.0.1 or even the name of your computer.

    If you ignore the -h flag, then it will assume it's local host.

    And if you want a fancier UI, you can install mysql-admin, which adds a shortcut on Applications>Programming with the mysql admin client.

    Host is used when you're connecting a remote server.
    Last edited by Can+~; April 22nd, 2008 at 06:57 PM.
    "Just in terms of allocation of time resources, religion is not very efficient. There's a lot more I could be doing on a Sunday morning."
    -Bill Gates

  4. #4
    Join Date
    Oct 2007
    Beans
    41

    Question Re: Problem with using mysql

    I have typed hostname command and gotten my hostname.

    when I type:
    mysql -h myhostname -u myusername -p
    I get the error
    Can't connect to MySQL server on myhostname.

    I know that I typed my password correct, my username is correct, and so forth.

    When I tried doing just
    mysql -u myusername -p
    I get the error:
    Access denied for user 'username'@'localhost' (using password: YES)

  5. #5
    Join Date
    Aug 2007
    Location
    127.0.0.1
    Beans
    1,800
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Problem with using mysql

    again, username = root

    not your username, not the root of the system, is the root on the mysql, the first account created by default on install.

    Example:

    mysql -u root -p
    password: <invisible characters>
    Last edited by Can+~; April 22nd, 2008 at 07:07 PM.
    "Just in terms of allocation of time resources, religion is not very efficient. There's a lot more I could be doing on a Sunday morning."
    -Bill Gates

  6. #6
    Join Date
    Oct 2007
    Beans
    41

    Question Re: Problem with using mysql

    Thanks a lot Can+~. It works perfectly 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
  •