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?
Related
I am using Mariadb 10.1.34 on Centos 7.3. All DB servers have same configuration and they are working properly.
However one DB server is unable to locally connect through socket (/mysqldata/mysql/mysql.sock).
Error:
mysql -uroot -p
Enter password: *********
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '' (111 "Connection refused")
I perceive from the Error that the MySql client is unable to find the socket file (/mysqldata/mysql/mysql.sock).
If we mention the socket file:
mysql -uroot -p -S /mysqldata/mysql/mysql.sock
Enter password: *********
Then the MySql client connects properly.
Despite that I have defined socket=/mysqldata/mysql/mysql.sock in the [MYSQLD] and [client] sections of the configuration file (/etc/my.cnf).
The socket file is created on "service mariadb start" and deleted on "service mariadb stop". The MySql client is unable to find the socket file.
Help is needed to resolve this problem.
I tried to connect mySQL from remote server I followed these commands:
convert
bind-address = 127.0.0.1
to
bind-address = 0.0.0.0
and followed by,
systemctl restart mysql.service
then login to mySQL server in local machine and gave following command:
GRANT ALL ON databaseName.* TO 'user'#'xx.xx.xx.xx' IDENTIFIED BY 'password';
then tried in remote server with following command:
mysql -u user -p -h xx.xx.xx.xx
Got error as:
ERROR 2003 (HY000): Can't connect to MySQL server on 'xx.xx.xx.xx'
Can someone help on this? How can I connect mySQL remotely?
I am able to access mysql via workbench with hostname: localhost and port: 3306 which were present by default, but I can't connect it via bash
mysql -u root -p
returns follwing error:
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
How to connect mysql in docker via bash?
You need to use the -h arugument:
mysql -h 127.0.0.1 -u root -p
The error message tells you that mysql tried to connect to the unix socket /var/run/mysqld/mysqld.sock and not to the network socket.
I am trying to remotely connect to my hidden service MySQL DB
mysql -u root -p -h 127.0.0.1 connected
works fine on local host
I am following this tutorial on reddit:
/r/TOR/comments/222bum/running_mysql_as_a_hidden_service/
I have xampp running on Ubuntu and and tor MySQL listens to port 3306 and Apache on 80
I am trying to connect to my DB remotely with command:
proxychains mysql -u root -p -h http://xxxxxxx.onion DBNAME
Getting this error:
ERROR 2003 (HY000): Can't connect to MySQL server on
'http://xxxxxxxxx.onion' (111)
tried this with socat
socat TCP-LISTEN:3308 SOCKS4A:127.0.0.1:xxxxj.onion:3306,socksport=9050
or
socat TCP-LISTEN:3308 SOCKS4A:localhost:xxxxj.onion:3306,socksport=9050
did not work in tor panel it says but only when i try to proxychains mysql -h 127.0.0.1 -u user -p P 33606
Sep 26 18:43:09.000 [warn] Rejecting SOCKS request for anonymous
connection to private address [scrubbed].
thanks for reply but still cant get it to work
root:/var/lib/tor/hidden_service$ proxychains mysql -u user -h TOR.onion database -p
ProxyChains-3.1 (http://proxychains.sf.net)
Enter password:
|DNS-request| TOR.onion
|S-chain|-<>-127.0.0.1:9050-<><>-4.2.2.2:53-<><>-OK`enter code here`
|DNS-response| TOR.onion is 104.239.213.7
|S-chain|-<>-127.0.0.1:9050-<><>-104.239.213.7:3306-<--timeout
ERROR 2003 (HY000): Can't connect to MySQL server on 'TOR.onion' (111)
GRANT ALL ON Databasename.* TO 'user'#'127.0.0.1
getting some error in console phpmyadmin SQL error
i m prety new to this any help is appreicated
mysql workbench works fine on localhost but when trying to add the onion instead of localhost it dosent work:******
Any suggestions thanks
Change your interface to 0.0.0.0 so external connections can happen (bind-address=0.0.0.0 in my.cnf or equivalent)
GRANT access to the external IP in MySQL: GRANT ALL ON <DB>.* TO '<user>'#'<external_ip>';
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)