step 1 :修改配置文件 my.cnf —— 将bind -address = 127.0.0.1 改为 bind-address = 0.0.0.0
step2 :sudo /etc/init.d/mysql restart 重新启动mysql,mysql -p -u root 进入mysql 执行授权命令
grant all privileges on *.* to ‘用户’@'%’ identified by ‘密码’ with grant option;
好了,恭喜你,能够在其他电脑上通过 mysql -h host(安装并配置好mysql的ubuntu的IP地址) -u root -p 进行访问ubuntu下的mysql
create database XXX default charset=utf8