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


  1. 下载mysql的zip包

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


  1.  复制文件和设置环境变量

具体参照: http://jingyan.baidu.com/article/f3ad7d0ffc061a09c3345bf0.html


  1.  设置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


  1.   添加用户
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)