1.
不能执行语句,需要在mysql里设置,windows下是edit–>preferences–>SQL Editor
把右边的最后一行,“safe update”对用的那一行的选框按钮去掉。再重启一下软件
2 远程连接数据库
(1)
(2)
(3)
(4)
(5)
如果显示错误信息:host ... is not allowed to connect to this MySql server,则说明远程服务器上的MySQL没有允许远程连接
则可以通过以下方法来修改服务器上的MySQL,
例如,让用户名为myuser使用密码为mypassword从任何主机连接到mysql服务器
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
允许用户myuser从ip为118.184.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'118.184.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
如果你想允许用户myuser从ip为192.168.1.6的主机连接到mysql服务器的dk数据库,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON dk.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY 'mypassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;