一、错误:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'password('1234')' at line 1
二、原因:猜测是MySQL版本问题,新旧版本语法不同
三、解决方法:
旧版本用:
SET PASSWORD FOR user1@localhost=PASSWORD('1234');
新版本用:
ALTER USER user1@localhost IDENTIFIED BY '12345';
或
SET PASSWORD FOR user1@localhost = '123456';
Tip:需登录MySQL后才能执行该命令