Before connecting the need to configure what database server
Enter the mysql database, select mysql
mysql> use mysql;
Select the host table
mysql> select host from user;
Update host, then exit.
mysql> update user set host = '%' where user='root';
Restart the database, complete.
# service mysqld restart