Cannot connect to database server using mysql workbench under Debian 9 - mysql

I've installed mysql server 5.5 in localhost under debian 9. When I open MySQL Workbench I cannot create a connection. When I try to create a connection an alert appears "cannot connect to database server. Access denied for user root at localhost"
I tried to access in mysql server using:
mysql -u root -p -h 127.0.0.1 -P 3306
And I use the password 'root' that I've before setted
Error 1968 appears and I don't know how to do.
Any Idea?

Related

How do I connect to my database URL (retrieved from heroku) using mysql installed on my local xampp in windows

I have heroku app running using a Jaws Maria db as a add on, I want to access the database using xampp's mysql on windows 7 machine. I got my database url via
heroku config:get JAWSDB_MARIA_URL --app MYAPPNAME
which got me a string like
mysql://username:password#serveraddress:3306/dbname
i'm trying to access this database url via the command from my cmd
E:/xampp/mysql/bin/mysql -u username -h serveraddress.amazonaws.com -P 3306 -D dbname -p
accoring to the thread Access mysql remote database from command line
after providing the password im getting an error
Can't connect to MySQL server on 'serveraddress.amazonaws.com' (10060 "Unknown error")
Whereas if i try to connect to ths database from c9.io I can access it using the command
mysql -u username -h serveraddress.amazonaws.com:3306 -p
Can anyone help me so that I can access it from xampp's mysql in windows as well. Cant figure out what am I missing here

XAMPP and hidden service MYSQL DB cant connect

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>';

can't access mysql in zend server

Abhimanyus-MacBook-Pro:~ abhimanyuaryan$ /usr/local/zend/mysql/bin/mysql -u root
ERROR 2002 (HY000): Can't connect to local MySQL server through
socket '/usr/local/zend/mysql/tmp/mysql.sock' (2)
I was trying to use MySQL database via terminal using the above command but then this error message showed up. How to fix it?
try bellow command
mysql -u root -h localhost -p
and give the root password
or you can install phpmyadmin and use it directly form the http://localhost/phpmyadmin after installing phpmyadmin.

connect to mysql database server in Windows from Vagrant box

I installed mysql server 5.6, and I can connect to it using mysql workbench, but I'm wondering if I can connect to it from Vagrant box, and I tried the following command, but failed:
vagrant#sdi03:~$ mysql -h 127.0.0.1 --port=3366 -u root -p
Enter password:
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)
Note that I purposely run the mysql server on port 3366 instead of 3306, because I have another mysql server running on Vagrant box on port 3306.
I'm using success connect to ip adress of my windows, it's 192.168.1.55
mysql -u konst -p -h 192.168.1.55
PS I can't connect with root, i create new mysqluser konst with admin's rights

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)