Linux下进入MySQL

2019-03-07  本文已影响0人  ce5154e79490
  1. 进入MySQL:mysql -u 账号 -p

  2. 展示所有的数据库:show databases;

  3. 进入某个数据库:use 数据库名称;

  4. 查询操作:select * from 表名称;

    5.连接问题: image.png
    1. 给某个ip授权:
grant all privileges on *.* to 'root'@'192.168.1.1' identified by '123456'
  1. 给所有ip授权:
grant all privileges on *.* to 'root'@'%' identified by '123456' 

3.授权之后立即生效:

flush privileges;
  1. 如果想要撤销赋予的权限:
revoke all on *.* from 'root'@'%' identified by '123456';
  1. 执行SQL语句:source /home/***.sql
上一篇 下一篇

猜你喜欢

热点阅读