Chinaunix首页 | 论坛 | 博客
  • 博客访问: 242216
  • 博文数量: 52
  • 博客积分: 1355
  • 博客等级: 中尉
  • 技术积分: 485
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-06 12:23
文章分类

全部博文(52)

文章存档

2013年(5)

2012年(16)

2011年(26)

2010年(2)

2009年(1)

2008年(2)

我的朋友

分类: Mysql/postgreSQL

2012-10-31 11:13:23

first go to mysql install dir
mysql.exe -u root -p
enter your password.

check exist databases:
mysql>show databases;

create the db:
mysql>create database abc;
create the db use some charset beside default:
mysql>create database if not exists abc default charset utf8mb4 COLLATE utf8mb4_unicode_ci;
ps: for some unusual chinese characters utf8mb4 is better than utf8;
cerate user:
1.local user:
mysql> create user user1@localhost identified by '123';
2.remote user:
mysql> create user user1@'%'identified by '123';

授权
所有权限
mysql> grant all privileges on abc.* to  user1@localhost;
部分权限
mysql> grant select, insert, update, delete on abc.* to  user1@'%';
mysql> flush privileges;

修改密码
mysql> set password for user1 =‘456’;
for mysql after 5.5
mysql> set password for user1 =password(‘456’);
mysql> flush privileges;
或者
mysql> use mysql;
mysql> update user set password = '456' where user = 'user1';
for mysql after 5.5

mysql> update user set password = password('456') where user = 'user1';
mysql> flush privileges;

阅读(1061) | 评论(0) | 转发(0) |
0

上一篇:mysql授权

下一篇:linux设置jdk环境变量

给主人留下些什么吧!~~