I tried to import data through Sqoop using the following command.
sqoop import -connect jdbc:mysql://localhost/test_sqoop --username root --table test
but I got the connection refuse error.
And I found out I can't connect to mysql and got this error:
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock'
And I also found out if I don't execute start-dfs.sh
,mysql.sock
exists in /var/lib/mysql/mysql.sock
.
After I executed start-dfs.sh
,mysql.sock
would be gone and I can't connect to mysql.
Below is /etc/my.cnf configuration.
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock