The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
zhushuhai:~ apple$ /usr/local/MySQL/bin
-bash: /usr/local/MySQL/bin: is a directory
zhushuhai:~ apple$ cd /usr/local/MySQL/bin -- 切换到MySQL服务
zhushuhai:bin apple$ mysql -u root -p -- 登录mysql
Enter password: -- 输入密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 33
Server version: 8.0.16 MySQL Community Server - GPL
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> show databases; -- 显示已有数据库
+--------------------+
| Database |
+--------------------+
| aaa |
| finedb |
| information_schema |
| my_zsh331 |
| my_zsh333 |
| mysql |
| performance_schema |
| sql习题 |
| sys |
+--------------------+
9 rows in set (0.00 sec)
mysql> CREATE DATABASE IF NOT EXISTS finedb123 default charset utf8 COLLATE utf8_bin; -- 创建数据库finedb123,注意:后面的分号;
Query OK, 1 row affected, 2 warnings (0.00 sec)
mysql> show databases; -- 显示数据库(finedb123已创建成功)
+--------------------+
| Database |
+--------------------+
| aaa |
| finedb |
| finedb123 | -- 刚创建的数据库
| information_schema |
| my_zsh331 |
| my_zsh333 |
| mysql |
| performance_schema |
| sql习题 |
| sys |
+--------------------+
10 rows in set (0.00 sec)
————————————————————
上面是整个流程,你拿去参考学习,「注意事项和对应的创建语句」都给你了,只能说到这了…