ubuntu 安装mysql 5.7.17

来源:互联网 发布:视频剪裁软件 编辑:程序博客网 时间:2024/06/07 10:03
 一、安装服务:
apt-get install mysql-server
二、修改配置:

/etc/mysql/mysql.conf.d# vim mysqld.cnf

1、注释掉:

#skip-external-locking

2、执行命令:
update mysql.user set plugin = 'mysql_native_password' where user='root';

flush privileges;

quit;

3、更新密码:

update mysql.user set authentication_string=password('new_password') where user='root';

4、打开远程开关

update  mysql.user set host='%' where user='root'; 

三、常用命令介绍

启动mysql服务:sudo start mysql
停止mysql服务:sudo stop mysql
重启mysql服务: sudo restart mysql

0 0