Solution:
Step1:Look into directory of /tmp and find whether the mysql.sock is exist. If not,then step2.
Step2: Usecommand <find / -name "my.cnf"> to find the configuration filesfrom Mysql. Use command <cat my.cnf> to look at the content, and you willfind: Socket=/$directory/mysql.sock
Step3: ln-s /$directory/mysql.socket /tmp/mysql.socket
Step4: Goto /tmp and you can find the mysql.socket is exist as below and you can tryconnect Mysql again: