Needed to do this to setup a MySQL server on my local machine to facilitate unit test testing…  I used XAMPP and started the MySQL app. After it starts open your terminal and type the following:

mysql -u root
mysql: GRANT ALL ON *.* TO '<some_user>'@'%' IDENTIFIED BY '<some_password>'
mysql: FLUSH PRIVILEGES;
mysql: EXIT
mysql -u <some_user> -p<some_password>
mysql: exit

You should now be able to connect to your local mysql server from any host using the supplied name and password.