Homebrew安裝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 HomebrewCopyright (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_installationSecuring 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: yThere 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                  filePlease 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 requirementsNew 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 requirementsNew 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

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/17153.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/17153.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/17153.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

IDEA使用Maven打包項目的所有的依賴

要使用 Maven 命令將 Spring Boot 項目的依賴打包到 lib 文件夾中,你可以在終端中運行以下命令: mvn dependency:copy-dependencies -DoutputDirectory./lib這個命令會將項目的所有依賴(包括運行時依賴)復制到當前目錄的 lib 文件…

Windows操作系統基本知識整理

目錄 引言 一、Windows操作系統的發展歷史 1.1 Windows 1.0到Windows 3.0 1.2 Windows 95到Windows Me 1.3 Windows NT到Windows 2000 1.4 Windows XP到Windows 7 1.5 Windows 8到Windows 10 二、Windows操作系統的核心組件 2.1 內核 2.2 文件系統 2.3 圖形用戶界面&…

內網橫向移動小補充 --->PTK

大家別急,我的基于資源的約束性委派攻擊還在寫,這個東西一時半會講不清楚,所以我在這里先來補充一點橫向移動以前沒說好的東西!!! 在更啦,別催啦~~~~ 還記得我之前在內網滲透里面講過這個PTK&a…

亞馬遜云主管馬特·加爾曼面臨壓力,致力于在人工智能領域趕超競爭對手

每周跟蹤AI熱點新聞動向和震撼發展 想要探索生成式人工智能的前沿進展嗎?訂閱我們的簡報,深入解析最新的技術突破、實際應用案例和未來的趨勢。與全球數同行一同,從行業內部的深度分析和實用指南中受益。不要錯過這個機會,成為AI領…

mysql中連接查詢的成本

大家好。上篇文章我們講了mysql中成本的含義以及單表查詢如何計算成本。現在我們接著講講mysql中連接查詢的成本。 在講之前,我們先創建兩張一樣的表single_table和single_table2,并在表中插入10000條數據。在下面的講解中,我們稱single_tab…

java并發工具類都有哪些

Java中的并發工具類包括: CountDownLatch CountDownLatch允許一個或多個線程等待其他線程完成某些操作。它通常用于線程間的同步,例如在一個線程完成其工作后通知其他線程繼續執行。 CyclicBarrier CyclicBarrier是一個同步輔助類,它允許一…

使用@Transactional 注解下,事務失效的場景

前言 Transactional是一種基于注解管理事務的方式,spring通過動態代理的方式為目標方法實現事務管理的增強。 Transactional使用起來方便,但也需要注意引起Transactional失效的場景,本文總結了七種情況,下面進行逐一分析。 一、…

【面試必看】Java并發

并發 1. 線程 1. 線程vs進程 進程是程序的一次執行過程,是系統運行程序的基本單位,因此進程是動態的。 系統運行一個程序即是一個進程從創建,運行到消亡的過程。在 Java 中,當我們啟動 main 函數時其實就是啟動了一個 JVM 的進…

ChaosMeta V0.7.0 版本發布 進入CNCF混沌工程全景圖

混沌工程 ChaosMeta 的全新版本 V0.7.0 現已正式發布!該版本包含了許多新特性和增強功能,在編排界面提供了多集群管理,在代碼層面支持多命令下發通道的選擇。另外由螞蟻集團發起的ChaosMeta于北京時間2024年1月10日正式進入CNCF混沌工程全景圖…

20232906 2023-2024-2 《網絡與系統攻防技術》第十一次作業

20232906 2023-2024-2 《網絡與系統攻防技術》第十一次作業 1.實驗內容 一、web瀏覽器滲透攻擊 任務:使用攻擊機和Windows靶機進行瀏覽器滲透攻擊實驗,體驗網頁木馬構造及實施瀏覽器攻擊的實際過程。 二、取證分析實踐—網頁木馬攻擊場景分析 ①首先你…

07_Servlet

Servlet 一 Servlet簡介 1.1 動態資源和靜態資源 靜態資源 無需在程序運行時通過代碼運行生成的資源,在程序運行之前就寫好的資源. 例如:html css js img ,音頻文件和視頻文件 動態資源 需要在程序運行時通過代碼運行生成的資源,在程序運行之前無法確定的數據,運行時動態生成…

轉行一年了

關注、星標公眾號,直達精彩內容 ID:技術讓夢想更偉大 整理:李肖遙 來公司一年了。 說是轉行其實還是在半導體行業,熟悉我的朋友知道 ,我在18年開始進入半導體行業,那個時候想著行業很重要,站對了…

【前端三劍客之JS】詳解JS

1. JS的引入方式 (1). 內部腳本方式引入 在頁面上,通過一對script標簽引入js代碼.script代碼放置位置有一定隨意性,一般放在head標簽中. (2).外部腳本方式引入. 內部腳本只能在當前頁面中使用,代碼復用度不高.可以將腳本放在單獨的js文件…

HG/T 6088-2022 透水道路用涂料檢測

透水混凝土是指由水泥、礦物摻合料、骨料、外加劑及水等主要材料經拌合形成的,具有透水功能的混凝土材料,用于其表面的涂料稱為透水道路用涂料。 HG/T 6088-2022透水道路用涂料檢測項目: 測試指標 測試方法 有害物質限量 GB 38468 在容器…

io.net 是什么,DePIN(去中心化物理基礎設施網絡)

目錄 io.net 是什么 io.net去中心化原理 DePIN(去中心化物理基礎設施網絡)

氣泡水位計的安裝方法詳解(二)

氣泡水位計的安裝方法詳解(二) 產品簡介 氣泡式水位計ZL-BWL-013是一款適用于水文、水利信息化建設領域的新一代水位測量類設備,產品執行GB/T 11828.2-2022標準。ZL-BWL-013氣泡水位計,具有安裝方便、易于操作,高精度…

算法刷題day54:搜索(一)

目錄 引言一、池塘計數二、城堡問題三、山峰和山谷四、迷宮問題五、武士風度的牛六、抓住那頭牛七、矩陣距離八、魔板 引言 針對于藍橋杯,搜索問題還是非常之重要的,在省賽前深知暴搜的重要性,所以提前先把提高課的搜索一章給看了&#xff0…

odoo10 編寫圖片上傳接口(獲取外部訪問鏈接)

首先你需要一個模型 class Vehicle(models.Model):_name vehicleimage fields.Binary(string"圖片", attachmentTrue)編寫圖片訪問接口 http.route(/vehicle/image/<int:vehicle_id>, typehttp, authpublic)def vehicle_image(self, vehicle_id, **kwargs)…

分布式鎖的原理和實現(Go)

文章目錄 為什么需要分布式鎖&#xff1f;go語言分布式鎖的實現Redis自己的實現紅鎖是什么別人的帶紅鎖的實現 etcdzk的實現 為什么需要分布式鎖&#xff1f; 保證分布式系統并發請求或不同服務實例操作共享資源的安全性&#xff0c;通過一種協調機制來保證在同一時刻只有一個…

設計模式17——模板方法模式

寫文章的初心主要是用來幫助自己快速的回憶這個模式該怎么用&#xff0c;主要是下面的UML圖可以起到大作用&#xff0c;在你學習過一遍以后可能會遺忘&#xff0c;忘記了不要緊&#xff0c;只要看一眼UML圖就能想起來了。同時也請大家多多指教。 模板方法模式&#xff08;Temp…