Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

How To connect with mysql in HDPCDeveloper Practice exam instance

avatar
New Member

Hi

I was trying to connect with mysql to check databases.. as mysql is already running in namenode

I have used following command

mysql --user root -p and got following error

ERROR 2002(HY000) : Can't connect to local MySQL server thorugh socket 'var/lib/MySQL/MySQL.scok' (2)

1 ACCEPTED SOLUTION

avatar
Guru

@Shikha Verma - The MySQL instance is running on a machine called "namenode", not localhost. If you want to run the mysql client, you should SSH onto namenode first:

$ ssh root@namenode

The password is "hadoop".

Once you are on the namenode, then you can run mysql:

# mysql --user root -p

That password is also "hadoop". Let me know if that works.

View solution in original post

4 REPLIES 4

avatar

By not specifying the hostname, you are attempting to connect to "localhost". When you connect to "localhost", the socket connector is used, which doesn't look like it was configured properly. To use the TCP/IP connector, you should connect to mysql using the hostname:

mysql --host your.hostname.goes.here --user root -p

avatar

@Shikha Verma - did this answer help? If so, please accept. Otherwise, let me know if you need further assistance.

avatar
Guru

@Shikha Verma - The MySQL instance is running on a machine called "namenode", not localhost. If you want to run the mysql client, you should SSH onto namenode first:

$ ssh root@namenode

The password is "hadoop".

Once you are on the namenode, then you can run mysql:

# mysql --user root -p

That password is also "hadoop". Let me know if that works.

avatar
New Member

Thanks ..it worked