Unable to access MySql server in ubuntu 14.04 - mysql

I have installed XAMPP, when I'm trying to open mysql by sudo mysql -u root -p, i am getting the below error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/var/run/mysqld/mysqld.sock' (2).

Related

WSL Connect to MySQL Server 8 on Windows Doesn't Work

MySQL Workbench and MySQL server 8 is installed in Windows. In my WSL2 prompt, I installed the MySQL 8 client. I want to connect to the MySQL server from WSL2.
When I try mysql -u root -p -h 127.0.0.1 I get
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
On WSL I have "mysql Ver 8.0.21-0ubuntu0.20.04.3 for Linux on x86_64 ((Ubuntu))" installed. If I just try mysql localhost I get
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I believe this is because I don't have the MySQL server installed on WSL just in Windows. I had this working a few days ago but then I had a Windows auto-update and I could no longer connect.
Use windows local ip address instead of 127.0.0.1

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' in ubuntu server

i've a problem in my Ubuntu server mysql configuration.
Firtsly, i tried to install phpmyadmin. In the installation, i've seen "Your password does not satistfy the current policy requeirements". Than i searched in stackoverflow and i couldn't find a problem, i tried to delete and reinstall mysql server via this page : https://support.rackspace.com/how-to/mysql-resetting-a-lost-mysql-root-password/ but now i've some problem ass :
root#ip-*-*-*-*:/var/www# mysql -u root -p
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Could you please help me?
Thanks.

Error while starting mysql without host name

While installing MySQL I am facing following error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
but when I tried with host address it actually started
mysql -h 127.0.0.1 mysql -u root -p
why I am not getting logged in without hostname?

Can't connect to mysql server on ubuntu 14.04 ERROR 2002 (HY000)

When trying to connect I get this message
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
I've tried purging mysql-server and reinstalling it, but to no avail.
My problem was that I was attempting to connect over ssh.
I changed the bind-address property in /etc/mysql/my.conf from 192.168.1.2 to 10.0.0.2

How can i connect to mysql using terminal?

I'm trying to connect to the mysql server on my mac using terminal. I've already got MAMP on my mac but now I have installed XAMPP. when I type this into my terminal
mysql -u root -p
it comes up with this message...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket
'/Applications/MAMP/tmp/mysql/mysql.sock' (2)
I'm wondering is it because of XAMPP? Any suggestions?
have you tried
mysql -h 127.0.0.1 -u root -p
(if the mysql server isn't running on your local box, substitute the IP address of the mysql server for 127.0.0.1)