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

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

Run this to check:

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:

sudo systemctl start mysql

Run this to automatically run it at boot:

sudo systemctl enable mysql

You can do the same in YaST->System->Services Manager as well if you prefer a GUI.

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

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… rotfl!

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.

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)

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.

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:

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).

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/mariadb/repositories/#mirror=klaus&distro_release=opensuse13-amd64&distro=openSUSE&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/en/mysql-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.

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.

NOW IT WORKS !!!

Thanks a lot to all of you !!