mysql> grant all PRIVILEGES on *.* to root@'%' identified by 'root123';
Query OK, 0 rows affected (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql>
注:生产环境最好只允许root在特定IP的机器上才能远程访问。
Linux公社的RSS地址:https://www.linuxidc.com/rssFeed.aspx