Results 1 to 10 of 10

Thread: Can' login into mysql

  1. #1
    Join Date
    Dec 2008
    Location
    Montevideo, Uruguay
    Posts
    451

    Default Can' login into mysql

    Every time I try to log in into mysql, it returns a error like this:

    # mysql -u root -p
    Enter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory")

    Any clue ?

    Thanks in advance for any feedback

    regards,

    agunet74
    agunet74

  2. #2

    Default Re: Can' login into mysql

    Quote Originally Posted by agunet74 View Post
    Every time I try to log in into mysql, it returns a error like this:

    # mysql -u root -p
    Enter password:
    ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysql/mysql.sock' (2 "No such file or directory")

    Any clue ?
    Have you actually started the server? Your error message seems to suggest it is not running.

    Run this to check:
    Code:
    sudo systemctl status mysql
    (if it failed to start, this should also give a clue why)

    Run this to start it if it is not running:
    Code:
    sudo systemctl start mysql
    Run this to automatically run it at boot:
    Code:
    sudo systemctl enable mysql
    You can do the same in YaST->System->Services Manager as well if you prefer a GUI.
    Last edited by wolfi323; 22-Dec-2014 at 15:09.

  3. #3
    Join Date
    Dec 2008
    Location
    Montevideo, Uruguay
    Posts
    451

    Default Re: Can' login into mysql

    Here's the result:

    # sudo systemctl status mysql

    We trust you have received the usual lecture from the local System
    Administrator. It usually boils down to these three things:

    #1) Respect the privacy of others.
    #2) Think before you type.
    #3) With great power comes great responsibility.

    root's password:
    Sorry, try again.
    root's password:
    Sorry, try again.
    root's password:
    Sorry, try again.
    sudo: 3 incorrect password attempts
    #


    And I'm sure that I'm typing the correct password, because I try one and one again

    And this happens since I updated suse from 3.1 to 3.2. (I really don't know I that has something to do with this but just in case).
    Maybe it's a bug. I'll look for it in bugzilla and report it in case is not there.

    Any other feedback is welcome well
    agunet74

  4. #4

    Default Re: Can' login into mysql

    Quote Originally Posted by agunet74 View Post
    And I'm sure that I'm typing the correct password, because I try one and one again
    You need to type in the _root_ password, not your user's.
    On a fresh installation they should be the same, but if you changed your user's password, the root password will still be the same.

    And this happens since I updated suse from 3.1 to 3.2.
    You're using 3.2? Wow, that is old...

    Joke aside, I think you mean you upgraded from 13.1 to 13.2, right?

    Maybe it's a bug. I'll look for it in bugzilla and report it in case is not there.
    I am not aware of any bug. And sudo works fine here on more than one 13.2 system (all upgraded from 13.1).

    Any other feedback is welcome well
    Then run "systemctl status mysql" without sudo. But it won't give as much information then.

    Try "su", does that accept your root password?

    Can you run YaST?

    Without gaining root permissions, it will not be possible to run the mysql server I'm afraid.

  5. #5
    Join Date
    Feb 2009
    Location
    Spain
    Posts
    25,547

    Default Re: Can' login into mysql

    On 2014-12-23 19:56, agunet74 wrote:
    >
    > Here's the result:
    >
    > # sudo systemctl status mysql


    That's root's password, not the mysql password. You are using 'sudo'.

    --
    Cheers / Saludos,

    Carlos E. R.
    (from 13.1 x86_64 "Bottle" at Telcontar)

  6. #6
    Join Date
    Dec 2008
    Location
    Montevideo, Uruguay
    Posts
    451

    Default Re: Can' login into mysql

    First of all, I was using suse 13.2 not 3.1 LOL!!
    Second I'm using suse 13.2 not 3.2 LOL !

    Wll, no I enter the root password and here is te result:

    # sudo systemctl status mysql
    root's password:
    mysql.service - MySQL server
    Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled)
    Active: inactive (dead)

    #


    I don't know how to activate this service. I enter Yast -> System -> Service Management -> click on mysql service -> Click on Start /Stop

    And now:

    # sudo systemctl status mysql
    mysql.service - MySQL server
    Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled)
    Active: inactive (dead)

    It doesn't ask for a root password.
    agunet74

  7. #7

    Default Re: Can' login into mysql

    Quote Originally Posted by agunet74 View Post
    Wll, no I enter the root password and here is te result:

    # sudo systemctl status mysql
    root's password:
    mysql.service - MySQL server
    Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled)
    Active: inactive (dead)
    So it should be started during boot already, but this fails for some reason.

    I don't know how to activate this service. I enter Yast -> System -> Service Management -> click on mysql service -> Click on Start /Stop
    This is one possibility, or run "sudo systemctl start mysql".

    And now:

    # sudo systemctl status mysql
    mysql.service - MySQL server
    Loaded: loaded (/usr/lib/systemd/system/mysql.service; enabled)
    Active: inactive (dead)
    Well, it fails to start.
    But is this the whole output?
    There should be some clue to why it fails to start.

    Try to stop it first, maybe even kill it to make sure it is not running, then start it again, and then query its status:
    Code:
    sudo systemctl stop mysql
    sudo killall mysqld
    sudo systemctl start mysql
    sudo systemctl status mysql
    It doesn't ask for a root password.
    sudo remembers the password for some time (5 minutes I think).

  8. #8

    Default Re: Can' login into mysql

    You have "#" in the shell prompt, so it seems that you are already root? No need to 'sudo' then! But even root can 'sudo' of course. In the 'sudo' dialog provide user's (in case root's) password (of the OS root user - not the MySQL root user). Once your sudo authentication has been approved, the MySQL client will ask you for MySQL authentication detals.



    But as you upgraded from a previous version there may also be some issue with upgrading MySQL. OpenSuSE 12.3 ships with MariaDB 10.0.14. I am not sure what 12.2 and 12.1 did (12.2 had a MariaDB 5.x version, I think. 12.1 may have had a server from Oracle and not from MariaDB). You may simply uninstall the old server (your data will not be deleted - but still I'd recommend that you make a copy of the /datadir) and install again from either SuSE' s repo or MariaDB's (https://downloads.mariadb.org/mariad...E&version=10.0). Don't follow their (ignorant as regards SuSE) recommendation on how to register the repo - just use YaST or zypper as you normally would. If you use a MySQL/MariaDB /datadir from an older version don't miss to run 'mysql_upgrade' (http://dev.mysql.com/doc/refman/5.6/...l-upgrade.html) immediately after the upgrade.

    I have communicated (quite a lot) on the MariaDB mailing list about their repo for SuSE (I am working for a company who is a MariaDB business partner - they distribute our programs and we provide support for those programs to their customers) . There are some few issues with the MariaDB repo - most important
    1) "rpm -qa" command don't list packages installed from the MariaDB repo.
    2) conflicts with KDE and some KDE applications are not resolved automatically (these applications will - as they have an option to save their data in MySQL (embedded or not) - have a dependency on a two shared libraries that needs to be replaced). One such application is Amarok. These dependencies is not deteted by MariaDB RPMs . You can resolve the conflict manually from YaST GUI.

  9. #9

    Default Re: Can' login into mysql

    Apart from this, you will not at all need to be (OS)-root user to invoke the 'mysql' client and connect to the MySQL server, as long as you provide valid MySQL authentication details (for any existing MySQL user) . The file /usr/bin/mysql (the client program) is readable for all (and if it is not, it is a bug somewhere!).

    Aren't you just confusing the concept of 'root' in Linux and in MySQL? They are completely unrelated.

  10. #10
    Join Date
    Dec 2008
    Location
    Montevideo, Uruguay
    Posts
    451

    Default Re: Can' login into mysql

    NOW IT WORKS !!!!!!

    Thanks a lot to all of you !!
    agunet74

Posting Permissions

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