Find the answer to your Linux question:
Results 1 to 5 of 5
Like Tree1Likes
  • 1 Post By mizzle
hullo i tried folloing a thread from yaswanth4b7 but i hit a dead end, although it was related to mine. Am trying to run mysql but my password is rejected. ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! jonniemuk's Avatar
    Join Date
    Jul 2009
    Location
    E.Africa
    Posts
    59

    error 2002 on mysql login


    hullo i tried folloing a thread from yaswanth4b7 but i hit a dead end, although it was related to mine. Am trying to run mysql but my password is rejected. I just installed mysql and didnt do any configuration.

    I have mysql installed and running fedora 16.

    [root@me /]# rpm -qa | grep mysql
    mysql-libs-5.5.28-2.fc16.i686
    libdbi-dbd-mysql-0.8.3-8.fc16.i686
    mysql-connector-odbc-5.1.8-3.fc16.i686
    mysql-connector-java-5.1.17-1.fc16.1.i686
    mysql-server-5.5.28-2.fc16.i686
    mysql-5.5.28-2.fc16.i686
    [/CODE]


    Code:
    [root@me /]# mysql_secure_installation
    
    
    NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
          SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
    
    
    In order to log into MySQL to secure it, we'll need the current
    password for the root user.  If you've just installed MySQL, and
    you haven't set the root password yet, the password will be blank,
    so you should just press enter here.
    
    Enter current password for root (enter for none): 
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
    So any more information i can give for you to help me?

  2. #2
    Linux Guru
    Join Date
    Oct 2007
    Location
    Tucson AZ
    Posts
    3,190
    Use the command below to see if it is running:

    ps -e | grep my

    Check the link below:

    MySQL :: Re: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

  3. #3
    Just Joined! jonniemuk's Avatar
    Join Date
    Jul 2009
    Location
    E.Africa
    Posts
    59
    ps -e | grep my. Does not give any results.
    True /var/lib/mysql/mysql.sock does not exist, but to the link above, the point to the path /var/lib/mysql is empty. i followed the link changed permissions and edited the file /etc/my.cnf, to add the lines given in the link. it has still not worked.

  4. #4
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    890
    Make sure mysql is running.
    service mysql status

    Some distros the command is mysqld.

  5. #5
    Just Joined! jonniemuk's Avatar
    Join Date
    Jul 2009
    Location
    E.Africa
    Posts
    59
    Thanks it worked, i checked the mysqld service and started it.
    Code:
    #service mysqld status
    Code:
    #service mysqld start
    The problem was calling the service mysql instead of mysqld, and using the root password yet it had not been set. So i just hit return and entered the mysql monitor.

    Code:
    #mysql -u root -p
    Thanks again.......

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •