mysql

一、Mac下安装&连接mysql

1、下载

MySQL :: Download MySQL Community Server

进入下载页面,选择对应的版本,mac上选择第一个,dmg安装包即可

2、安装

下载后,双击打开,按提示下一步安装完成

command+空格,输入mysql,点击设置中的mysql,如下所示:

出现如下页面,表示安装成功

3、启动、停止mysql服务

点击上图中的Start MySQL Server,启动服务

服务启动后,按钮变成Stop MySQL Server,点击,停止服务

4、连接

1、使用mysql 可视化工具,比如MySQL Workbench、navicat

2、使用命令行连接

安装后直接输入mysql命令,提示zsh: command not found: mysql

需要将mysql 安装路径加到系统变量中

(1).打开.bash_profile 文件

open -e ~/.bash_profile

(2)将mysql路径添加进去

export PATH=${PATH}:/usr/local/mysql/bin

(3)配置立即生效

source ~/.bash_profile

(4) 连接

mysql -u root -p

输入密码

wyl@WYLdeMacBook-Air bin % mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.3.0 MySQL Community Server - GPL

Copyright (c) 2000, 2024, Oracle and/or its affiliates.

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>

二、linux 下连接mysql

1、连接前,查看下mysql服务是否启动: ps -ef | grep mysql

2、连接:mysql -u 用户名 -p 回车,然后输入密码

      如果提示:Access denied for user 'beta'@'localhost' (using password: YES),表示账号权限不够

三、mysql 命令

相关推荐

  1. <span style='color:red;'>MySQL</span>

    MySQL

    2024-02-11 12:20:02      55 阅读
  2. <span style='color:red;'>Mysql</span>

    Mysql

    2024-02-11 12:20:02      70 阅读
  3. MySQL

    2024-02-11 12:20:02       49 阅读
  4. <span style='color:red;'>Mysql</span>

    Mysql

    2024-02-11 12:20:02      70 阅读
  5. <span style='color:red;'>MySQL</span>

    MySQL

    2024-02-11 12:20:02      50 阅读
  6. MySQL

    2024-02-11 12:20:02       50 阅读
  7. Mysql

    2024-02-11 12:20:02       50 阅读
  8. <span style='color:red;'>MYSQL</span>

    MYSQL

    2024-02-11 12:20:02      52 阅读
  9. <span style='color:red;'>mysql</span>

    mysql

    2024-02-11 12:20:02      49 阅读
  10. MySQL

    2024-02-11 12:20:02       48 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-11 12:20:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-11 12:20:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-02-11 12:20:02       82 阅读
  4. Python语言-面向对象

    2024-02-11 12:20:02       91 阅读

热门阅读

  1. Nginx配置php留档

    2024-02-11 12:20:02       44 阅读
  2. RuoYi模块功能分析:第八章定时任务

    2024-02-11 12:20:02       44 阅读
  3. P2036 [COCI2008-2009 #2] PERKET题解

    2024-02-11 12:20:02       46 阅读
  4. 学习数据结构和算法的第6天

    2024-02-11 12:20:02       44 阅读
  5. 设计模式-适配器模式 Adapter

    2024-02-11 12:20:02       48 阅读
  6. 应急响应-挖矿木马-常规处置方法

    2024-02-11 12:20:02       51 阅读
  7. 面试心得--面试前应该如何准备

    2024-02-11 12:20:02       42 阅读
  8. 用Python实现刘谦春晚魔术

    2024-02-11 12:20:02       48 阅读
  9. vector如何实现有序数组?

    2024-02-11 12:20:02       45 阅读
  10. VMware16安装CentOS7mini 中遇到的一些问题

    2024-02-11 12:20:02       55 阅读
  11. Linux文本三剑客(1)

    2024-02-11 12:20:02       43 阅读
  12. Python列表中的remove功能及用法举例

    2024-02-11 12:20:02       47 阅读