Support Questions

Find answers, ask questions, and share your expertise

problem connection to Httpp://hadoop:3306

avatar
Explorer

I am trying to connect to this url :http://hadoop:3306 but its not working, can someone explain to me.

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Aymen Rahal

The default Mysql Port 3306 is a TCP/IP port (non http). So you can not connect to it via Http. If you want to remotely connect to MySQL DB and want to run some queries then youi will need to install "mysql-clients" (Or use some third party tools like DBVisualizer / JDBC code ..etc) on your local machine and then using the following format you will be able to connect to it.

# mysql --host=remote.example.com --port=3306 -u root -p

.

For more details on this please refer to MySQL standard documentation: https://dev.mysql.com/doc/refman/5.6/en/connecting.html

View solution in original post

7 REPLIES 7

avatar
Master Mentor

@Aymen Rahal

What service are you trying to connect to? That looks the mysql database port ! Incase you wanted the Ambari port is

http://ambari-server:8080

Where ambari-server is the FQDN of the host where Ambari server

Please clarify.

avatar
Explorer

@Geoffrey Shelton Okot

yes the ambari port is 8080, I want to connect to mysql service.

avatar

When you say you want to connect to mysql service, do you mean you want to login to MySQL shell? Or you are trying to connect MySQL over http?

avatar
Master Mentor

@Aymen Rahal

The default Mysql Port 3306 is a TCP/IP port (non http). So you can not connect to it via Http. If you want to remotely connect to MySQL DB and want to run some queries then youi will need to install "mysql-clients" (Or use some third party tools like DBVisualizer / JDBC code ..etc) on your local machine and then using the following format you will be able to connect to it.

# mysql --host=remote.example.com --port=3306 -u root -p

.

For more details on this please refer to MySQL standard documentation: https://dev.mysql.com/doc/refman/5.6/en/connecting.html

avatar
Explorer

# mysql --host=hadoop --port=3306 -u admin -p Enter password: ERROR 2003 (HY000): Can't connect to MySQL server on 'hadoop' (111)

avatar
Master Mentor

@Aymen Rahal

To connect to the CLI If you have the root password then from the Mysql host you do, notice the -p is attached no spaces assuming the password is welcome1

# mysql -u root -pwelcome1 

If you don't have the mysql root password then you can change it as below, in the below example I want my new password to be 'welcome1'

# mysql -u root UPDATE mysql.user SET Password=PASSWORD('welcome1') WHERE User='root'; flush privileges;

Otherwise, you have the below clients to choose from

  • MySQL Workbench (Mac, Windows, Linux), Free, open-source
  • phpMyAdmin (web app), Free, open-source
  • Toad for MySQL (Windows), Free
  • MySQL-Front (Windows), Free, open-source
  • Neor Profile SQL (Mac, Windows, Linux), Free

You should implement the secure Mysql/mariaDB installation see link

avatar
Master Mentor

@Aymen Rahal

Check my update !!!!