mysql基本使用

#登录

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

以新密码登录

posted @ 2017-10-20 17:05  程绩  阅读(204)  评论(0编辑  收藏  举报