修改具体字段的值
update [表名] set [字段名]= replace([字段名],'old_value','new_value);
java.sql.SQLException: Access denied for user 'root'@'ipAddress'at (数据库名)
表示该对象不是远程对象,不能通过该对象远程访问数据
解决:
方案一:改表:
use mysql ;select user,host,password from user;
update user set host = '%' where user='root';
方案二:授权法:
例如,你想myuser使用mypassword从任何主机连接到mysql服务器的话。
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'%' IDENTIFIED BY 'mypassword' WITHGRANT OPTION;
如果你想允许用户myuser从ip为192.168.1.3的主机连接到mysql服务器,并使用mypassword作为密码
GRANT ALL PRIVILEGES ON *.* TO 'myuser'@'192.168.1.3' IDENTIFIED BY'mypassword' WITH GRANT OPTION;