ubuntu 16.04 数据库mysql安装与管理
1.安装mysql的客户端与服务器端
$>sudo apt-get install mysql-server mysql-client
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。
2.管理服务
1.启动
$>sudo service mysql start
2.停止
$>sudo service mysql stop
3.重启
$>sudo service mysql restart
3.配置允许远程连接
1.找到mysql配置文件并修改
$>sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf # bind-address=127.0.0.1 # 注释本行
2.登录mysql,运行如下命令
# 给root用户授予在任意主机(%)访问任意数据库的所有权限 # grant all privileges on *.* to 'root'@'%' identified by '密码' with grant option;
mysql>grant all privileges on *.* to 'root'@'%' identified by 'root' with grant option; # 我的密码是root
mysql>flush privileges;
3.重启mysql
$>sudo service mysql restart

更多精彩