GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '694521' WITH GRANT OPTION; 授权外部连接
FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION; --格式如下 GRANT ALL PRIVILEGES ON *.* TO 'user'@'remoteip' IDENTIFIED BY 'password' WITH GRANT OPTION; --更新权限 FLUSH PRIVILEGES;
GRANT ALL PRIVILEGES ON mydb.* TO 'root'@'%' WITH GRANT OPTION;
在linux下安装完成mysql,通过执行service mysql start 确保mysql是启动的。在终端执行sudo apt-get install mysql-workbench在线安装mysql-workbench。安装完成后执行mysql-workbench,启动图形界面,但是却无法连接。在终端执行mysql -u root 却能进入mysql,说明mysql服务器是启动的。需要执行命令 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; 再启动mysql-workbench 即可连接。