ubuntu安装mysql-server命令: apt-get install mysql-server
ubuntu安装mysql-client命令: apt-get install mysql-client
设置远程连接步骤
1.进入配置文件: vim /etc/mysql/mysql.conf.d/mysqld.cnf
注释掉bind-address= 127.0.0.1
2.进入mysql, 选择mysql数据库, 删除user表下的匿名用户
3.给root用户添加所有的权限
grant all privileges on *.* to 'root'@'%' identified by 'Admin123' with grant option;
4.重启数据库
service mysql restart
其他命令:
启动服务命令:service mysql start
关闭服务命令: service mysql stop
默认配置文件存在: /etc/mysql/mysql.cnf
/etc/mysql/mysql.cnf.d/