linux环境添加mysql-server密码

service mysqld start;

mysql

grant all privileges on *.* to 'root'@'%' identified by '123456' with grant option;

delete from user where host!='%';

之后重启服务或者在mysql中:flush privileges;

 

登陆命令:mysql -uroot -p

 

posted @ 2019-07-23 16:59  allenysn  阅读(247)  评论(0编辑  收藏  举报