Homebrew安装mysql之后,启动和使用MySQL服务:

Mac通过brew安装Redis和启动Redis服务,超简单安装一目了然 前言:此文章的基础是Mac系统已安装过Homebrew,如果未安装,此处奉上教程链接如下,详细介绍Homebrew的用法 Mac安装和使用Homebrew(mac极简软件包管理工具) 文章目录brew安装Redis1️⃣、查看Redis服务2️⃣、安装指定版本Redis3️⃣、配置环境变量4️⃣、启动Redis(以下启动方式,teminal窗口关闭后服务不会停止)5️⃣、查看本地运行的服务列表... 阅读详情
AI摘要

本文介绍了Homebrew安装mysql后,MySQL服务的启动、停止、重启操作,还提及进入MySQL命令行界面的方法,同时指出使用过程中可能遇到的问题。

启动MySQL服务:

brew services start mysql

手动启动服务:

mysql.server start

例如:

mysql.server start
Starting MySQL
.. SUCCESS! 

停止 MySQL服务:

brew services stop mysql

或者

mysql.server stop

重启MySQL服务:

brew services restart mysql
或者
mysql.server restart

进入 MySQL命令行界面:

mysql -u root -p
例如:
 mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.3.0 Homebrew

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> exit
Bye



关掉MySQL服务:
exit

例如:

mysql_secure_installation

Securing the MySQL server deployment.

Connecting to MySQL using a blank password.

VALIDATE PASSWORD COMPONENT can be used to test passwords
and improve security. It checks the strength of password
and allows the users to set only those passwords which are
secure enough. Would you like to setup VALIDATE PASSWORD component?

Press y|Y for Yes, any other key for No: y

There are three levels of password validation policy:

LOW    Length >= 8
MEDIUM Length >= 8, numeric, mixed case, and special characters
STRONG Length >= 8, numeric, mixed case, special characters and dictionary                  file

Please enter 0 = LOW, 1 = MEDIUM and 2 = STRONG: 0
Please set the password for root here.

New password: 

Re-enter new password: 

Estimated strength of the password: 25 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : 

New password: 

Re-enter new password: 

Estimated strength of the password: 25 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
 ... Failed! Error: Your password does not satisfy the current policy requirements

New password: 

Re-enter new password: 

Estimated strength of the password: 25 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
 ... Failed! Error: Your password does not satisfy the current policy requirements

New password: 

Re-enter new password: 

Estimated strength of the password: 50 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) :  

New password: 

Re-enter new password: 

Estimated strength of the password: 50 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) :           

New password: 

Re-enter new password: 

Estimated strength of the password: 100 
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
By default, a MySQL installation has an anonymous user,
allowing anyone to log into MySQL without having to have
a user account created for them. This is intended only for
testing, and to make the installation go a bit smoother.
You should remove them before moving into a production
environment.

Remove anonymous users? (Press y|Y for Yes, any other key for No) : y
Success.


Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : 

 ... skipping.
By default, MySQL comes with a database named 'test' that
anyone can access. This is also intended only for testing,
and should be removed before moving into a production
environment.


Remove test database and access to it? (Press y|Y for Yes, any other key for No) : Normally, root should only be allowed to connect from
'localhost'. This ensures that someone cannot guess at
the root password from the network.

Disallow root login remotely? (Press y|Y for Yes, any other key for No) : 
 ... skipping.
Reloading the privilege tables will ensure that all changes
made so far will take effect immediately.

Reload privilege tables now? (Press y|Y for Yes, any other key for No) : 
 ... skipping.
All done! 

遇到问题:

brew services start mysql
==> Tapping homebrew/services
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 2877, done.
remote: Counting objects: 100% (2877/2877), done.
remote: Compressing objects: 100% (1287/1287), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: early EOFs:  20% (576/2877), 356.00 KiB | 10.00 KiB/s
fatal: fetch-pack: invalid index-pack output
Error: Failure while executing; `git clone https://github.com/Homebrew/homebrew-services /opt/homebrew/Library/Taps/homebrew/homebrew-services --origin=origin --template= --config core.fsmonitor=false` exited with 128.
Error: Failure while executing; `/opt/homebrew/bin/brew tap homebrew/services` exited with 1.

又遇到问题:

git clone https://github.com/Homebrew/homebrew-services /opt/homebrew/Library/Taps/homebrew/homebrew-services --origin=origin --template= --config core.fsmonitor=false
Cloning into '/opt/homebrew/Library/Taps/homebrew/homebrew-services'...
remote: Enumerating objects: 2877, done.
remote: Counting objects: 100% (2877/2877), done.
remote: Compressing objects: 100% (1287/1287), done.
error: RPC failed; curl 18 transfer closed with outstanding read data remaining
error: 5242 bytes of body are still expected
fetch-pack: unexpected disconnect while reading sideband packet
fatal: early EOF
fatal: fetch-pack: invalid index-pack output

Homebrew:Mac os 使用brew工具时报错No remote ‘origin‘ Homebrew:Mac os 使用brew工具时报错No remote ‘origin’ 使用 brew update 时报错: brew update Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-cask, skipping update! Warning: No remote 'origin' in /opt/homebrew/Library/Taps/homebrew/homebrew-co 阅读详情

相关推荐

Mac安装Homebrew

镜像下载、域名解析、时间同步请点击 阿里云开源镜像站 一、简介 Homebrew是一款包管理工具,目前支持macOS和Linux系统。主要有四个部分组成:brew、homebrew-core 、homebrew-cask、homebrew-bottles 二、官方脚本下载安装及配置环境变量 首先我们可以进入官网地址:https://brew.sh 获取下载链接,如下: 在安装完成后如果遇到command not found: brew的错误,一般是环境变量无效,这里则需要使用之前介绍使用过的echo $

m0_60028455的博客 2644

mac使用brew安装启动mysql步骤

目录1.搜索mysql版本2.安装mysql3.环境变量配置4.启动服务5.设置密码参考链接 1.搜索mysql版本 brew search mysql 搜索一下版本,看一下自己要下载的版本。然后我下载的是mysql@5.7。 2.安装mysql brew install mysql@5.7 3.环境变量配置 安装成功后brew会给配置环境变量的提示 在终端执行环境变量配置: echo 'export PATH="/opt/homebrew/opt/mysql@5.7/bin:$PATH"' >&

sfh2018的博客 1万+

macOS上Homebrew安装的MySQL服务启动失败:ERROR 2002 (HY000) 排查与修复实录

本文详细记录了在macOS上使用Homebrew安装的MySQL服务启动失败(ERROR 2002 (HY000))的排查与修复过程。从基础检查到深入分析InnoDB文件结构,最终通过重新初始化数据库解决问题,并分享了预防措施与日常维护建议,帮助开发者高效应对类似数据库连接问题。

weixin_29574585的博客 370

MAC 用 brew安装 mysql并且设置开机自启动

1.安装默认版可以直接执行安装命令2.若要指定版本安装加上@版本号即可,比如我们常用的5.7。

红烧柯基的博客 3876

为什么我的Win11家庭版找不到BitLocker?教你两种强制关闭加密的隐藏方法

本文解释了Win11家庭版为何缺少BitLocker功能,并提供了两种强制关闭加密的隐藏方法。通过注册表修改和PowerShell命令,用户可以调出隐藏的加密控制面板或直接操控加密引擎,解决家庭版设备加密的管理难题。

weixin_42535703的博客 1761

实战指南:如何用DCCRN模型提升语音增强效果(附代码示例)

本文提供了基于DCCRN模型进行语音增强的实战指南。通过深入解析复数网络如何协同处理语音的幅度与相位信息,并附有完整的PyTorch代码实现,帮助开发者从数据准备、模型搭建到训练调优,构建高效的实时语音增强系统,有效提升嘈杂环境下的语音清晰度。

weixin_29054245的博客 478

Mac通过Homebrew安装MySQL使用MySQL命令无法启动和关闭服务

前言 晚上在看Node.Js连接MySQL数据库内容,一时手痒就想撸一下代码,于是我写完Node.Js代码后突然发现换了MAC电脑后就一直没有装MySQL,我顺手通过Homebrew 敲了一个 brew install mysql 命令,Homebrew就自动安装了MySQL,安装完毕后我大喜,以为这就ojbk了,没想到哦,在终端上使用MySQL命令居然启动不了MySQL数据库的服务,于是我突然想到MySQL是通过Homebrew安装的那么命令应该另有玄机,果然是这样,现在记录一...

明哥 2226

亚马逊广告接口 amazon advertising

亚马逊广告接口官方说明:https://advertising.amazon.com/API/docs/en-us/setting-up/account-setup 一:注册aws开发者账号 注册地址:https://developer.amazon.com 二:填写注册资料 三:进入控制台,生成安全配置文件 进入 Login with Amazon 菜单: 创建配置文件: 四:申请广告接入权限 申请地址:https://advertising.amazon.com/zh-cn/about-api

lzy66666的博客 4775

mac m1+homebrew 安装MySQL/MongoDB/Redis/Elasticsearch,并启动服务

这里基本都是参考官网了,仅当做个笔录 1. 使用brew安装 警告⚠️ 不要直接 brew install mongodb 而是要执行下面两步。当然,执行之前还是要在终端设置代理。 brew tap mongodb/brew brew install mongodb-community@5.0 安装的路径记录下(mac M1版): /opt/homebrew/Cellar/mongodb-community/5.0.2 2. 启停mon...

young_kp的博客 887

淘宝链接跳转微信全攻略:自建合规中转页实现私域引流

在跨平台运营中,链接跳转是连接不同生态、实现流量引导的关键技术。其核心原理是通过服务器端或前端逻辑,将用户从一个平台的链接安全引导至目标页面,同时规避平台间的访问限制。这项技术的核心价值在于打破数据孤岛,实现跨平台用户沉淀与精细化运营,广泛应用于电商引流、私域流量构建和跨平台营销等场景。本文聚焦于**淘宝短链**与**企业微信**之间的跳转难题,提供了一套基于自建中转页面的完整工程解决方案,手把手教你如何通过合规的技术手段,将淘宝流量高效、安全地引导至微信生态,并实现数据追踪与客户分流。

weixin_34185512的博客 411

手把手教你用CV5200模块搭建无人机高清图传系统(含实测数据)

本文提供了一份基于CV5200模块搭建远距离无人机高清图传系统的完整实战指南。文章详细解析了系统架构、硬件连接、软件配置与优化,并分享了实地飞行测试数据。核心在于利用CV5200的LR-WiFi私有协议,在视距下实现数公里级的稳定高清视频传输,为DIY爱好者和行业应用提供了高性价比的解决方案。

day7的博客 719

MacOS M1 使用 Homebrew 安装 Mysql

MacOS M1 使用 Homebrew 安装 Mysql

geekqian的博客 3314

车道线检测1.0(Python+Opencv基础版)

车道线检测是指在道路上自动检测和识别车道线的过程。车道线是道路上的标记,用于指示车辆行驶的方向和位置。 通过对车道线进行检测和识别,自动驾驶和智能驾驶系统可以实现车辆的自动导航、车道保持、车道偏离警告等功能。

Dream_orz的博客 4262

Mac上安装和配置MySQL(使用Homebrew安装MySQL 8.0)

本文介绍在macOS 15.6上使用Homebrew安装配置MySQL 8.0:涵盖安装、环境变量、启动服务、安全加固与常用命令,帮助快速上手。

ZeroBugX的博客 1385

Zipformer在RK3588上的性能实测:比Conformer快多少?内存省多少?

本文在RK3588平台上对Zipformer和Conformer语音识别模型进行了全面的性能实测。结果显示,Zipformer在模型部署中展现出显著优势:推理速度比Conformer快约56%,峰值内存占用降低约60%,同时在AISHELL-1等测试集上保持了相当的识别准确率。这为边缘ASR应用提供了更高效、更节省资源的解决方案。

metal的博客 482

Rockchip 自定义vendorstorages数据再u-boot通过cmdline给kernel传递数据

本文介绍通过vendorstorages,允许保存和读取自定义数据。通过在U-Boot中读取这些数据并将其添加到cmdline中,将这些数据传递给Linux内核,实现了一个灵活的方式来配置和定制系统的需求。

我其实什么都不会 1818

Mac Homebrew安装Mysql设置开机启动

安装 brew install mysql 详细安装查看这里 启动Mysql服务 mysql.server start 设置开机启动 mkdir -p ~/Library/LaunchAgents cp /usr/local/Cellar/mysql/<Mysql版本号>/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysq

宋发元 1227

华为的C语言编程规范.pdf

华为技术有限公司内部技术规范。本规范制定了编写C语言程序的基本原则、规则和建议。从代码的清晰、简洁、可测试、安全、程序效率、可移植各个方面对C语言编程作出了具体指导。

homebrew mysql5.6_Homebrew 安装mysql

cmd:~dongjunjie$ brew search mysqlautomysqlbackup mysql++ mysql-connector-c mysql-sandbox mysql-utilities mysql@5.6mysql ...

weixin_42696333的博客 210

android 蓝牙通讯demo

android 下蓝牙通讯demo,实现了发现蓝牙,使能蓝牙,通过蓝牙发送消息。

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

【软件】在 macOS 上安装 MySQL

摘要:本文介绍了在macOS上安装MySQL的两种主要方法:使用Homebrew和安装包。通过Homebrew安装步骤包括安装Homebrew、MySQL、启动服务及安全配置;通过安装包安装则提供图形界面向导。两种方式完成后都建议运行安全脚本,并提供了验证安装、常见问题解决方法及密码重置步骤。Homebrew方式更简单推荐,而安装包适合偏好图形界面的用户。两种方法均能成功安装并运行MySQL数据库服务。

u011144881的博客 2043

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

brew 安装mysql_MacBook通过Homebrew安装mysql

Macbook通过Homebrew安装mysqlMacbook如何和安装mysql呢?有两种方式,一种是直接在mysql官网下载dmg可执行文件(https://dev.mysql.com/downloads/mysql/),直接双击就可以安装完成了。mac版mysql下载地址安装完成之后会在系统和偏好设置里面出现mysql的选项mysql安装成功打开mysql的安装选项,可以开启和关闭mysql...

weixin_30814159的博客 245

mac安装mysql mysql命令找不到_MacBook通过Homebrew安装mysql

Macbook通过Homebrew安装mysqlMacbook如何和安装mysql呢?有两种方式,一种是直接在mysql官网下载dmg可执行文件(https://dev.mysql.com/downloads/mysql/),直接双击就可以安装完成了。mac版mysql下载地址安装完成之后会在系统和偏好设置里面出现mysql的选项mysql安装成功打开mysql的安装选项,可以开启和关闭mysql...

weixin_39980184的博客 473

mysql homebrew_手把手教你Homebrew 安装 MySQL

安装 Homebrewbrew doctor 确认 brew 在正常工作brew update 更新包brew install mysql 安装 MySQL​==> Downloading https://homebrew.bintray.com/bottles/mysql-5.7.17.sierra.bottle.tar.gz################################...

weixin_29104059的博客 265

brew安装mysql5.6_Homebrew 安装mysql

在mac上安装软件,无疑安装一个brew是个很好的选择,关于brew是什么,怎么安装建议去brew官网查看,附上地址:brew官网 还有一篇博文http://www.cnblogs.com/xd502djj/p/6923690.html安装完成之后,安装其他的软件就很方便了。先搜索下cmd:~ dongjunjie$ brew search mysqlautomysqlbackup ...

weixin_32666923的博客 652

MacOS上Mysql的使用

这篇文章memo一下MacOS上Mysql的使用方式。

知行合一 止于至善 3933

mac 安装mysql_分享mac笔记本使用Homebrew安装mysql

安装我们将使用Homebrew安装mysql,同时也会安装mysql的相关文件。安装mysql前// 这是一个好习惯brew update brew install mysql在使用mysql前,我们需要做一些设置:unset TMPDIRmkdir /usr/local/varmysql_install_db --verbose --user=`whoami` --basedir="$(brew...

weixin_39589241的博客 128

mac检测是否安装mysql_mac安装mysql

mac使用brew安装mysql1 先查看mac上边有没有安装brew;brew -v 可查看brew版本没有安装可先安装brew:/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"2 检查brew能否正常工作:brew doctor3 更新brew包...

weixin_42395740的博客 7321
上一篇: 在Mac OS下编写第一个Flask代码
下一篇: ymysql.err.OperationalError: (1049, “Unknown database ‘testdb‘“)
DXB2021
博客等级 码龄5年 307粉丝 289原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值