首页 > 数据库技术 > 详细

mysql常用操作

时间:2018-07-22 11:56:46      阅读:178      评论:0      收藏:0      [点我收藏+]
1.初次启动
#mysql

update mysql.user set authentication_string=‘newpass‘,plugin=‘mysql_native_password ‘ where user=‘root‘;
flush privileges;
exit;

$ mysql -u root -p //本地登陆
$ mysql -u aloha -p -h ip //远程登陆

2.用户操作

use mysql;
create user ‘aloha‘@‘localhost‘ identified by ‘aloha‘; //创建用户

flush privileges;

grant all on mysql.user to aloha@localhost; //授权

show grants for aloha@localhost; //查看授权

revoke all on mysql.user from aloha@localhost; //取消授权
update user set authentication_string=‘123‘ where user=‘aloha‘; //修改密码

delete from user where user=‘aloha‘; //删除用户

drop user aloha@localhost; //删除用户

3.DDL数据定义

4.DML数据操作

mysql常用操作

原文:http://blog.51cto.com/dangxia/2148208

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!