版本

>bin\mysqld.exe --version
bin\mysqld.exe  Ver 5.7.18 for Win32 on AMD64 (MySQL Community Server (GPL))

配置

[mysqld]
basedir = "d:\\mysql"
datadir = "d:\\mysql\\data"

初始化

>bin\mysqld.exe --console --initialize-insecure

启动

>bin\mysqld.exe --console

登录

>bin\mysql -u root --skip-password

修改root密码

>alter user 'root'@'localhost' identified by 'password';

建立用户

>bin\mysql -u root -p
>create user 'username'@'%' indentified by 'password'

创建数据库

create database db;

提权

grant all privileges on db.* to username;
flush privileges;

允许root远程

grant all privileges on *.* to 'root'@'%' identified by 'password';
标签: database, mysql
日期: 2017-04-24 17:30:06, 7 years and 266 days ago
留言

回复不允许使用html标签

通过电子邮件通知我有后续评论.