当前位置: 移动技术网 > 科技>操作系统>Linux > ubuntu 16.04 数据库mysql安装与管理

ubuntu 16.04 数据库mysql安装与管理

2019年02月18日  | 移动技术网科技  | 我要评论

1.安装mysql的客户端与服务器端

  $>sudo apt-get install mysql-server mysql-client

 

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

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网