mysql 命令

一、mysql服务启动和停止

===net stop mysql

===net start mysql

二、登录mysql

===mysql -uroot -p            [mysql  -hlocalhost -uroot -p]

三、增加新用户

====格式【grant 权限 on 数据库.* to 用户名@登录主机 identified by "密码"】  如果希望能够任何机器则将登录主机改为%

grant  select ,insert ,update ,delete on mydb.* to user1@localhost identified by "";  

 

四、导出数据库

=====mysqldump -u root -p123456  database dbname>mysql.dbname  

五、导入数据库

======mysqlmport -u root -p12345<mysql.sql

六、显示表结构

======describe  mytable

七、查看用户拥有权限

=====show grants for 'root'@'localhost'

 

posted @   KLAPT  阅读(17)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· 没有源码,如何修改代码逻辑?
· PowerShell开发游戏 · 打蜜蜂
· 在鹅厂做java开发是什么体验
· WPF到Web的无缝过渡:英雄联盟客户端的OpenSilver迁移实战
历史上的今天:
2021-12-22 扫码登录实现原理
2021-12-22 序列化之serialVersionUID
点击右上角即可分享
微信分享提示