首页 > 数据库技术 > 详细

2019-05-14 MySQL通过dos命令操作数据库

时间:2019-05-14 18:53:36      阅读:118      评论:0      收藏:0      [点我收藏+]

use mysql;

-- 查询数据库
show databases;
-- 显示表
show TABLES;
-- 修改用户密码
alter user ‘test‘@‘%‘ identified with mysql_native_password by ‘Test12345678@‘;
update user set password=password("123") where user="test";
update mysql.user set password=‘123‘ where user=‘test‘;

-- 查询主机 用户名 密码 命名方式
select host,user,password,authentication_string from user;
-- 查询 数据库下的表
select table_name from information_schema.tables where table_schema=‘taotao‘;
-- 查询指定数据库中指定表的所有字段名column_name
select column_name from information_schema.columns where table_schema=‘taotao‘ and table_name=‘tb_content‘;
-- 查询表内容
select * from taotao.tb_content

 

CREATE USER ‘username‘@‘%‘ IDENTIFIED BY ‘password‘;
CREATE USER ‘username‘@‘localhost‘ IDENTIFIED BY ‘password‘;
update user set host=‘%‘ where user = ‘username‘;
update user set host=‘%‘ where user = ‘username‘;
-- 给用户授权限
GRANT ALL PRIVILEGES ON *.* TO ‘username‘@‘%‘ WITH GRANT OPTION;
-- 刷新配置
flush privileges;

2019-05-14 MySQL通过dos命令操作数据库

原文:https://www.cnblogs.com/wbly2019/p/10863636.html

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