码迷,mamicode.com
首页 > 数据库 > 详细

mysql基本使用

时间:2017-10-20 18:31:33      阅读:217      评论:0      收藏:0      [点我收藏+]

标签:cal   find   admin   解密   刷新   base   exit   table   密码登录   

#登录

mysql -uroot -p123

#查看用户

select user();

#退出

quit

exit

\q

#查看帮助信息

help create user;

#创建账号

create user ‘egon‘@‘192.168.11.*‘ identified by ‘123‘;

create user ‘egon‘@‘192.168.11.1‘ identifled by ‘123‘;

create user ‘egon‘@‘%‘ indenrified by ‘123‘;

#授权

grant all privileges

grant all on db1.t1 to ‘egon‘@‘%‘;

grant all on *.* to ‘egon‘@‘%‘;

刷新

flush privileges;

#创建账号同时授权

grant all on *.* to ‘djj‘@‘%‘ identified by ‘123‘;

flush privileges;

#远程连接mysql

show databases;

#修改密码

命令行》mysqladmin -uroot -p‘123‘ password 123

命令行》\mysql -uroot -p123

#破解密码

杀死mysql服务

>tskill |findstr mysql

>tskill mysqld

>tskill -f /PID 5320

>mysql --skip-grant-tables #跳过授权表启动

mysql>update mysql.user set password =password(‘‘)where user=‘root‘ and  host=‘localhost‘;

mysql >flish privileges;

tskill mysqld

tasklist |findstr mysql

mysqld

以新密码登录

mysql基本使用

标签:cal   find   admin   解密   刷新   base   exit   table   密码登录   

原文地址:http://www.cnblogs.com/djjv/p/7700411.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!