Ee8587ff296d00aca981a41ed6824a5a
MySQL开发手册(一) MySQL的安装与配置

(1)安装MySql


  • 下载MySQL dmg 包, 从官网 : http://www.mysql.com/downloads/ 进入, 点击下方的DOWNLOADS : MySQL Community Server
  • 配置环境变量
    1. 进入终端,输入:cd ~
    2. 命令:touch .bash_profile
    3. 命令:open -e .bash_profile
    4. 新增加:export PATH = ${PATH}:/usr/local/mysql/bin
    5. 保存重新进入 #### (2)MySql连接与断开

  • mysql -u root -p : 输入账号密码打开mysql
  • exit : 退出mysql
wangchundeMacBook-Pro:~ wangchun$ mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 8.0.13 MySQL Community Server - GPL

Copyright (c) 2000, 2018, 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           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| sys                |
+--------------------+
4 rows in set (0.01 sec)

mysql> exit
Bye
wangchundeMacBook-Pro:~ wangchun$ 

笔记资源下载链接 ,支持PDF、ENEX印象笔记、HTML,方便大家整理导入

© 著作权归作者所有
这个作品真棒,我要支持一下!
主要帮助小白掌握MySQL数据库的增删改查操作,最终提供一个工具类语句手册和完善的学习笔记
0条评论
top Created with Sketch.