您的位置:首页 > 数据库 > MySQL

windos安装mysql(zip版本msql包) 初始化密码、新增用户

2015-11-15 00:00 681 查看
摘要: windos安装mysql(zip版本msql包) 初始化密码、新增用户

下载mysql的zip包

地址:http://cdn.mysql.com/Downloads/MySQLInstaller/mysql-installer-community-5.6.15.0.msi

复制文件和设置环境变量

具体参照: http://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html
设置root用户的密码

mysql> use mysql
Database changed
mysql> update user set password=password("your_password") where user="root";
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3  Changed: 3  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit;
Bye


添加用户

mysql>use mysql
mysql>insert into mysql.user(Host,User,Password) values("localhost","test",password("1234"));
mysql>create database testDB;
/* 设置权限*/
mysql> grant all privileges on testDB.*  to testr1;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  mysql