0

I am very new to mysql and I want to use remote login I followed this stack process but the command gives me nothing on the screen as listed on that link

$ lsof -i -P | grep :3306
$

this is the output.

What I did so far: I edited the file /etc/mysql/my.cnf to make change and looks like this

skip-external-locking
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address        = 0.0.0.0

What I want basically that I want remote login.But I am unable to that. I run following command on my terminal

$ mysql -h 127.6.110.2 -u adminTwz5PWn -p
$ enter password:
ERROR 1045 (28000): Access denied for user 'adminTwz5PWn'@'localhost' (using password: YES)

For sake of information needed I got this username and password from Openshift My concern is that how @'localhost' comes into the picture If I am providing the host ip in the command

I have user log in to mysql as follows

+------------------+---------------+
| user             | host          |
+------------------+---------------+
| root             | %             |
| root             | 127.0.0.1     |
| adminvKbP1kf     | 127.3.138.130 |
| adminTwz5PWn     | 127.6.110.2   |
| root             | ::1           |
| user             | hostname      |
| debian-sys-maint | localhost     |
| phpmyadmin       | localhost     |
| phpmyadmin_suraj | localhost     |
| root             | localhost     |
| suraj            | localhost     |
+------------------+---------------+

Please correct me if I am wrong anywhere. And what steps are needed to make this successfull

Community
  • 1
  • 1
Suraj Palwe
  • 2,080
  • 3
  • 26
  • 42

3 Answers3

1

If you are running this on OpenShift, and trying to connect from your local workstation, you need to use the rhc port-forward command. Check the answer to a very similar question, but it was using postgresql, you can adapt it very easily to use mysql: OpenShift: How to connect to postgresql from my PC

Community
  • 1
  • 1
  • You would use the rhc port-forward command, and connect to the mysql port for your application instead of the postgresql one. –  Mar 03 '15 at 01:12
0

You should first restart the MySQL server

/etc/init.d/mysqld restart
royki
  • 1,593
  • 3
  • 25
  • 45
0

It looks like Mysql is not able to resolve your host so it is defaulting to localhost. So when looking up permissions for your login, it evaluates 'adminTwz5PWn'@'localhost' instead of 'adminTwz5PWn'@IP. I suspect that problem has something to do with the bind address 0.0.0.0. Try changing the bind address to 127.0.0.1 or localhost and see what happens.

bluecollarcoder
  • 14,339
  • 4
  • 22
  • 18