mysql常用命令

-- 1.创建用户
CREATE USER 'thinknet'@'%' IDENTIFIED BY 'thinknet1234';

-- 2.创建数据库,并设置编码格式
CREATE DATABASE `TNd_platform` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;

-- 3.给thinknet用户赋予权限,所有权限
grant all privileges on *.* to thinknet@'%' identified by 'thinknet1234' WITH GRANT OPTION;

-- 4.给root用户赋予所有权限
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'thinknet1234' WITH GRANT OPTION;

-- 5.导入sql文件,【小提示:可能之前需要你use yourdb;】
source d:/data.sql;

你可能感兴趣的:(mysql)