安装
sudo apt-get install mysql-server mysql-client
然后按照提示输入
管理服务
- 启动
service mysql start
- 停止
service mysql stop
- 重启
service mysql restart
设置
远程连接
- 找到mysql配置文件并修改
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
将bind-address=127.0.0.1注释
- 登录mysql,运行命令
grant all privileges on *.* to 'root'@'%' identified by 'mysql' with grant option;
flush privileges;
- 重启mysql
- service mysql restart