C:\Users\masawa>mysql -u root -p
mysql> create user 'masawa'@'localhost' identified by 'masawa';
Query OK, 0 rows affected (0.01 sec)
mysql> select user, host, plugin from mysql.user;
+
| user | host | plugin |
+
| masawa | localhost | caching_sha2_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sha2_password |
| root | localhost | caching_sha2_password |
+
mysql> alter user 'masawa'@'localhost' identified WITH mysql_native_password by 'masawa';
Query OK, 0 rows affected (0.01 sec)
mysql> select user, host, plugin from mysql.user;
+
| user | host | plugin |
+
| masawa | localhost | mysql_native_password |
| mysql.infoschema | localhost | caching_sha2_password |
| mysql.session | localhost | caching_sha2_password |
| mysql.sys | localhost | caching_sha2_password |
| root | localhost | caching_sha2_password |
+
mysql> grant all privileges on *.* to 'masawa'@'localhost';
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
C:\Users\masawa>mysql -u masawa -p
Enter password: ******
mysql> create table person (id int auto_increment, name varchar(14) not null, primary key(id));
Query OK, 0 rows affected (0.07 sec)
mysql> show tables;
+
| Tables_in_test_db |
+
| person |
+
1 row in set (0.02 sec)
mysql> show columns from person;
+
| Field | Type | Null | Key | Default | Extra |
+
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(14) | NO | | NULL | |
+
2 rows in set (0.01 sec)