D:\Program Files\mysql\bin>mysqld --initialize --console
2019-02-14T11:47:59.282979Z 0 [System] [MY-013169] [Server] D:\Program Files\mysql\bin\mysqld.exe (mysqld 8.0.15) initializing of server in progress as process 13752
2019-02-14T11:47:59.284705Z 0 [Warning] [MY-013242] [Server] --character-set-server: 'utf8' is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2019-02-14T11:48:40.707445Z 5 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: 7CwffH5<(lem
2019-02-14T11:49:02.894787Z 0 [System] [MY-013170] [Server] D:\Program Files\mysql\bin\mysqld.exe (mysqld 8.0.15) initializing of server has completed
mysqld --install [服务名]
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';
CREATE DATABASE iodata;
use iodata;
/*show tables;
create table teacher
(
code varchar(20) primary key,
name varchar(20)
);*/
CREATE TABLE user_info
(
ID int NOT NULL AUTO_INCREMENT,/* 设置自动加的用户ID*/
user_id VARCHAR(200) NOT NULL,/*支持中英文200个字符的用户字符串*/
user_pass VARCHAR(200) NOT NULL,
user_create datetime(3) NULL DEFAULT CURRENT_TIMESTAMP(3),
user_modified datetime(3) NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3),
PRIMARY KEY (ID)/* 设置主键*/
);
use iodata;
CREATE USER 'porter'@'localhost' IDENTIFIED BY 'shuruniziji_mima';/* 创建用户 */
INSERT INTO iodata.user_info ( user_id, user_pass)
VALUES
( 'porter', '123');
grant all privileges on *.* to 'porter'@'%'; /* 放行用户的所有权限并允许远程网络连接 */