$10 reward: (2003, "Can't connect to MySQL server on '' ([Errno 61] Connection refused)")

I have downloaded everything, followed this guide: Install ERPNext on Mac :: n0c0de

trying to do:
bench new-site erpnext.local2

and I get
pymysql.err.OperationalError: (2003, “Can’t connect to MySQL server on ‘’ ([Errno 61] Connection refused)”)

spent like 3h on this bug already, can’t solve it. Ideas?
Environment: mac. I wonder if there is some fuck up because I had MAMP previously installed. I’m wiling to give $10 if anybody connects to my mac via teamview and fixed this shit. Thank you.

Try this for MacOS:

mysql -uroot -p

mysql> use mysql;

# View user's host
mysql> select 'host' from user where user='root';
# Update host to '%'
mysql> update user set host='%' where user='root';

mysql> flush privileges;
mysql> quit
vim /usr/local/etc/my.cnf
# Default Homebrew MySQL server config
bind-address =
# Restart and reconnect MySQL
mysql.server restart
mysql -uroot -h0.0.0.0 -p

If I try this: mysql -uroot -p
I get:
ERROR 1698 (28000): Access denied for user ‘root’@‘localhost’

I think the fact that I had MySQL installed with MAMP may have something to do with it. If I do
mariadb -uroot -p
then it opens ok, but then I get this:
MariaDB [(none)]> use mysql;

Reading table information for completion of table and column names

You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [mysql]> select ‘host’ from user where user=‘root’;


| host |


| host |


1 row in set (0.003 sec)

MariaDB [mysql]> update user set host=‘%’ where user=‘root’;

ERROR 1356 (HY000): View ‘mysql.user’ references invalid table(s) or column(s) or function(s) or definer/invoker of view lack rights to use them

  1. create root mysql user which can connect from any address (ip)
    connect to MySQL:

mariadb -u root -p

**change your_pass

CREATE USER 'root'@'%' IDENTIFIED BY 'your_pass';

add/change address mariadb server in sites/common_site_config.json:

“db_host”: “localhost”,

  1. create site:

bench new-site erpnext.local2 --db-name erpnext_local2 --mariadb-root-username root --mariadb-root-password you_pass --admin-password your_erpnext_admpass

bench --site erpnext.local2 install-app erpnext

Ok my friend @Suresh_Thakor fixed everything, we started from scratch, commands were something like this

bench drop site local --force
bench new-site Local --db-name local
bench get-app erpnext
cd sites
bench --site Local install-app erpnext
bench start