Guoguos-macbook-pro:myblog guoguo$ mysql-uroot-p123456
MySQL: [Warning] Using a password on the command line Inter Face can be insecure.
Welcome to the MySQL monitor. Commands end with, or \g.
Your MySQL Connection ID is 3334
Server version: 5.7.12 MySQL Community Server (GPL)
Copyright (c), Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
affiliates. Other names trademarks of their respective
owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Create library
mysql> CREATE database blog;
Query OK, 1 row affected (0.01 sec)
User-empowered
mysql> grant all privileges on blog.* to ' blog ' @ ' locahost ' identifie d by ' blog ';
Query OK, 0 rows affected, 1 Warning (0.02 sec)
Mysql> grant all privileges in blog.* to ' blogs ' @ '% ' identified by ' blog ';
Query OK, 0 rows affected, 1 warning (0.01 sec)
mysql> flush Privileges;
Query OK, 0 rows affected (0.01 sec)
Mysql> quit
Bye
Confirm Action
Guoguos-macbook-pro:myblog guoguo$ Mysql-ublog-pblog
MySQL: [Warning] Using a password on the command line interface can is insecure.
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL Connection ID is 3338
Server version:5.7.12 MySQL Community Server (GPL)
Copyright (c), Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of the Oracle Corporation and/or its
Affiliates. Other names trademarks of their respective
Owners.
Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql>
Mysql>
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| Information_schema |
| Blog |
+--------------------+
2 rows in Set (0.00 sec)
Mysql> Guoguo
MySQL CREATE database