linux下mysql的使用

来源:互联网 发布:查看基因甲基化数据库 编辑:程序博客网 时间:2024/04/30 10:35
  • 启动mysql:  /etc/rc.d/init.d/mysql start
  • 修改密码: 格式:mysqladmin -u用户名 -p旧密码 password 新密码
  • 使用密码登录:  mysql -u root -p
  • 显示数据库:  show databases;
  • 选择数据库:  use 数据库名;
  • 显示表:  show tables;
  • 显示表结构:  descibe 表名;
  • 远程登录mysql需要开启权限: 

grant 权限名(all表全部) on 库名(*表全部).表名(*表全部) to 用户名@"%"(%表全部IP) identified  by "密码"

例如: grant all on *.* to root@"%" identified by "111111"

  • 查看mysql的版本信息: /s
  • 判断是否支持分区: show variables like '%partition%'
原创粉丝点击