這篇文章為大家帶來了關於mysql的相關知識,其中主要整理了安裝常見報錯處理的相關問題,包括了無法啟動處理,錯誤1053、Winwods安裝初始化報錯、MySQL8安裝後無法登陸等等內容,下面一起來看一下,希望對大家有幫助。
推薦學習:mysql影片教學
#1.無法啟動處理,錯誤1053
Windows 無法啟動Mysql服務錯誤1053:服務沒有及時回應啟動或控制請求
1.1 結束進程
處理方法:
1、在命令列中敲入tasklist查看行程
2、依照行程名稱殺死行程
taskkill /f /t /im 行程名稱
#1.2 更改網路服務
Server2012位置
# 其他win7及win10作業系統
(2)、雙擊Administrators,並點選新增,再點選進階
(3)、把NETWORK SERVICE加入Administrators群組
1.3 刪除服務
#這裡記住,重新安裝Mysql就可以,2步驟操作重新執行(刪除原有Mysql文件,全部重新安裝即可)
還有個坑就是,如果還是啟動不了, 記得要開啟這個服務Windows Installer
預設情況下,該服務是手動啟動,需要進入服務管理中開啟。
右鍵開始-執行-輸入「services.msc」-Windows Installer-啟動
#2. Winwods安裝初始化報錯誤
Beginning configuration step: Writing configuration fileSaving my.ini configuration file... Saved my.ini configuration file. Ended configuration step: Writing configuration fileBeginning configuration step: Updating Windows Firewall rules Adding a Windows Firewall rule for MySQL80 on port 3306. Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 3306" protocol=TCP localport=3306 dir=in action=allow 确定。 Successfully added the Windows Firewall rule. Adding a Windows Firewall rule for MySQL80 on port 33060. Attempting to add a Windows Firewall rule with command: netsh.exe advfirewall firewall add rule name="Port 33060" protocol=TCP localport=33060 dir=in action=allow 确定。 Successfully added the Windows Firewall rule. Ended configuration step: Updating Windows Firewall rules Beginning configuration step: Adjusting Windows serviceAttempting to grant Network Service require filesystem permissions. Granted permissions. Adding new serviceNew service added Ended configuration step: Adjusting Windows serviceBeginning configuration step: Initializing database (may take a long time)Attempting to run MySQL Server with --initialize-insecure option... Starting process for MySQL Server 8.0.24... Starting process with command: C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe --defaults-file="C:\ProgramData\MySQL\MySQL Server 8.0\my.ini" --console --initialize-insecure=on --lower-case-table-names=1... Process for mysqld, with ID 2572, was run successfully and exited with code -1073741515. Failed to start process for MySQL Server 8.0.24. Database initialization failed. Ended configuration step: Initializing database (may take a long time)
安裝VC_redist.x86即可執行既OK
輸入gpedit. msc,開啟策略管理######### 啟用憑證更新後正常######由於部分系統映像建置較早,且無法進行系統更新,需要安裝系統修補程式包才能完成vc安裝######4.Centos環境rpm初始化MySQL報錯#########Centos7 預設提供的openssl 版本是1.0.2 的,某些php 擴充或其他軟體依賴1.1 以上版本,如果過低的話就會報錯### libssl.so.1.1: cannot open shared object file: No such file or directory### 也有執行openssl version 時報錯和上面一致,這是由於openssl 庫的位置不正確或未安裝1.1 以上版本的問題### 想要升級openssl 版本則需要手動進行編譯,報錯解決方式很簡單,安裝正確即可,### 下面說一下我以Centos7 為例,說一下具體的編譯安裝步驟# ###########–openssl版本確認### [root@jeames ~]# openssl version### OpenSSL 1.0.1e-fips 11 Feb 2013### –編譯openssl### tar - xvf openssl-1.1.1g.tar.gz### cd openssl-1.1.1g### ./config shared --openssldir=/usr/local/openssl --prefix=/usr/local/openssl### make && make install###
–配置
編譯完成後,使用openssl version,來查看一下當前openssl 版本號時,
你會發現還是1.0.2 ,所以這裡需要做一些額外的配置工作。
[root@jeames openssl-1.1.1g]# more /etc/ld.so.conf
include ld.so.conf.d/*.conf
[root@jeames openssl-1.1.1g ]# echo “/usr/local/lib64/” >> /etc/ld.so.conf
[root@jeames openssl-1.1.1g]# ldconfig
再次使用openssl version 驗證版本就可以了,
如果不行,可以嘗試下面的方式,
依序執行(先備份舊版本,再從新版本安裝位置建立軟連線)
mv /usr/bin/openssl /usr/bin/openssl .old
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
echoopen “/usr/local/openssl/lib” >> /etc/ld.so.conf
ldconfig -v
4.MySQL8安裝後無法登陸
第一辦法:
1.用指令編輯/etc/my.cnf設定文件,即:vim /etc/my.cnf 或vi /etc/my.cnf
2.在[mysqld]下新增skip-grant-tables,然後儲存並退出
3.重啟mysql服務:service mysqld restart
4.更改root用戶名
重啟以後,執行mysql指令進入mysql指令列
5.修改root使用者密碼,此處注意,有時候會報不允許修改,先flush privileges再執行即可
update mysql.user set authentication_string=password('root') where user='root' ; --5.7版本
flush privileges;
6.把/etc/my.cnf中的skip-grant-tables註解掉,然後重啟mysql,即:service mysqld restart
好了,下面就可以用root新的密碼登入了!
第二個方法:
在mysql8系統下,適用下列方法(全路徑)
G:\mysql-8.0 .23-winx64\bin\mysqld --datadir=G:\mysql-8.0.23-winx64\data80323308 --console --skip-grant-tables --shared-memory
################### ##########然後再開一個窗口,執行下面指令### cd G:\mysql-8.0.23-winx64\bin############### ######mysql> select user,host,authentication_string from mysql.user;### mysql> delete from mysql.user where user='root' ;### mysql> flush privileges; --記得刷新哈,如果提示無法建立### mysql> create user root@'%' identified with mysql_native_password by 'root';### mysql> grant all on ###.### to root@'%' with grant option;# ## mysql>; ### mysql> grant all on ###.### to root@'localhost' with grant option;### mysql> flush privileges;#########推薦學習影片:###mysqlsql教程######
以上是MySQL安裝常見報錯處理(總結分享)的詳細內容。更多資訊請關注PHP中文網其他相關文章!

mysqloffersvariousStorageengines,每個suitedfordferentusecases:1)InnodBisidealForapplicationsNeedingingAcidComplianCeanDhighConcurncurnency,supportingtransactionsancions and foreignkeys.2)myisamisbestforread-Heavy-Heavywyworks,lackingtransactionsactionsacupport.3)記憶

MySQL中常見的安全漏洞包括SQL注入、弱密碼、權限配置不當和未更新的軟件。 1.SQL注入可以通過使用預處理語句防止。 2.弱密碼可以通過強制使用強密碼策略避免。 3.權限配置不當可以通過定期審查和調整用戶權限解決。 4.未更新的軟件可以通過定期檢查和更新MySQL版本來修補。

在MySQL中識別慢查詢可以通過啟用慢查詢日誌並設置閾值來實現。 1.啟用慢查詢日誌並設置閾值。 2.查看和分析慢查詢日誌文件,使用工具如mysqldumpslow或pt-query-digest進行深入分析。 3.優化慢查詢可以通過索引優化、查詢重寫和避免使用SELECT*來實現。

要監控MySQL服務器的健康和性能,應關注系統健康、性能指標和查詢執行。 1)監控系統健康:使用top、htop或SHOWGLOBALSTATUS命令查看CPU、內存、磁盤I/O和網絡活動。 2)追踪性能指標:監控查詢每秒數、平均查詢時間和緩存命中率等關鍵指標。 3)確保查詢執行優化:啟用慢查詢日誌,記錄並優化執行時間超過設定閾值的查詢。

MySQL和MariaDB的主要區別在於性能、功能和許可證:1.MySQL由Oracle開發,MariaDB是其分支。 2.MariaDB在高負載環境中性能可能更好。 3.MariaDB提供了更多的存儲引擎和功能。 4.MySQL採用雙重許可證,MariaDB完全開源。選擇時應考慮現有基礎設施、性能需求、功能需求和許可證成本。

MySQL使用的是GPL許可證。 1)GPL許可證允許自由使用、修改和分發MySQL,但修改後的分發需遵循GPL。 2)商業許可證可避免公開修改,適合需要保密的商業應用。

選擇InnoDB而不是MyISAM的情況包括:1)需要事務支持,2)高並發環境,3)需要高數據一致性;反之,選擇MyISAM的情況包括:1)主要是讀操作,2)不需要事務支持。 InnoDB適合需要高數據一致性和事務處理的應用,如電商平台,而MyISAM適合讀密集型且無需事務的應用,如博客系統。

在MySQL中,外鍵的作用是建立表與表之間的關係,確保數據的一致性和完整性。外鍵通過引用完整性檢查和級聯操作維護數據的有效性,使用時需注意性能優化和避免常見錯誤。


熱AI工具

Undresser.AI Undress
人工智慧驅動的應用程序,用於創建逼真的裸體照片

AI Clothes Remover
用於從照片中去除衣服的線上人工智慧工具。

Undress AI Tool
免費脫衣圖片

Clothoff.io
AI脫衣器

Video Face Swap
使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

熱門文章

熱工具

SAP NetWeaver Server Adapter for Eclipse
將Eclipse與SAP NetWeaver應用伺服器整合。

Atom編輯器mac版下載
最受歡迎的的開源編輯器

EditPlus 中文破解版
體積小,語法高亮,不支援程式碼提示功能

SublimeText3 英文版
推薦:為Win版本,支援程式碼提示!

MantisBT
Mantis是一個易於部署的基於Web的缺陷追蹤工具,用於幫助產品缺陷追蹤。它需要PHP、MySQL和一個Web伺服器。請查看我們的演示和託管服務。