当前位置: 移动技术网 > IT编程>数据库>Mysql > MySQL8.0+常用命令

MySQL8.0+常用命令

2019年10月11日  | 移动技术网IT编程  | 我要评论

开启远程访问

通过以下命令开启root用户远程访问权限:

create user 'root'@'%' identified by 'password';
grant all on *.* to 'root'@'%';
alter user 'root'@'%' identified with mysql_native_password by 'password';
flush privileges;

注:其中,password为root的密码,flush privileges为刷新权限

导入数据

如导入csv表格,开启如下命令:

set global local_infile = 1

清空表内容

通过如下命令,不仅清空表的全部内容,同时自增长id也会从0开始,具体命令如下:

truncate table "表格名";

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网