mysql语句操作

sudo apt-get install mysql-server
数据库环境一键搭建完成
创建我们自己的各个数据库
create database hhg08 character set utf8;
创建完之后进入平台 mysql -u root -p
需要输入密码这些都是在安装mysql-server当中需要自己设定的默认就为空

进入后 use hhg08
创建用户 CREATE USER ' hhg_sql'@'% ' IDENTIFIED BY 'password';

grant all privileges on hhg08.* to hhg_sql@'%' identified by '123456';
#GRANT privileges ON databasename.tablename TO 'username'@'%'
flush privileges;

如果觉得输入错误了
DROP USER 'hhg_sql'@'%' ;

有相关数据源可以 source xxx.sql

admin  123456

猜你喜欢

转载自hhg08.iteye.com/blog/2248923