mysql配置远程访问

作者: wilsoncai 分类: database 发布时间: 2019-09-08 14:53
  • Open address for remote:
 Open address for remote: change bind-address to *

 vi /etc/mysql/mysql.conf.d/mysqld.cnf (ubuntu)
 vi /usr/local/etc/my.cnf (Mac)

 bind-address            = *
  • Run below to let root account could be used from remote
mysql> GRANT ALL ON testdb.* TO testuser@'xx.xx.xx.xx' IDENTIFIED BY 'testpassword';
mysql> FLUSH PRIVILEGES;
  • Restart mysql
#ubuntu
 sudo /etc/init.d/mysql restart 

#mac
 brew services start mysql  
or  
 mysql.server start 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

标签云