There are some differences in between Mac and Linux(CentOS) for my.cnf and some command line interfaces.
For your information, below is based on MySQL 8 and Mac OS X.
If you need to modify my.cnf, you will need to create it by vi /etc/my.cnf
# created by Chun Kang 2020-03-09 # based on the guide at https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html # [mysqld] character-set-server=utf8mb4 collation-server=utf8mb4_bin default-storage-engine=INNODB max_allowed_packet=256M innodb_log_file_size=2GB transaction-isola
Start MySQL
sudo /usr/local/mysql/support-files/mysql.server start
Stop MySQL
sudo /usr/local/mysql/support-files/mysql.server stop
Restart MySQL
sudo /usr/local/mysql/support-files/mysql.server restart
Set root access permission from all hosts
cd /usr/local/mysql/bin mysql -u root -p mysql
If you see > prompt, you can change it by below
update set host='%' from user where user='root';
If everything is okay, you can check it as following
select host, user, grant_priv from user; +-----------+------------------+------------+ | host | user | grant_priv | +-----------+------------------+------------+ | % | root | Y | | localhost | mysql.infoschema | N | | localhost | mysql.session | N | | localhost | mysql.sys | N | +-----------+------------------+------------+