mysql命令行操作

进入CMD并跳转到mysql的bin目录

如:cd /d D:\MySQL\MySQL Server 5.5\bin

数据库连接方法:

1.mysql -u user -p databasename

      password

2.mysql -uuser -ppassword

 

show databases;//查看所有数据库

use dbname;  //选择数据库

show tables;  //查看所有表

GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;//设置权限

flush privileges;//刷新权限

你可能感兴趣的:(mysql)