MySQL安裝常見報錯處理方法總結(jié)大全
前言
本文總結(jié)了MySQL安裝過程常見故障處理,分享給大家
1.無法啟動處理,錯誤1053
Windows 無法啟動Mysql服務(wù) 錯誤1053:服務(wù)沒有及時響應(yīng)啟動或控制請求
1.1 結(jié)束進(jìn)程
處理方法:
1、在命令行中敲入tasklist查看進(jìn)程
2、根據(jù)進(jìn)程名殺死進(jìn)程
taskkill /f /t /im 進(jìn)程名稱
1.2 更改網(wǎng)絡(luò)服務(wù)
Server2012位置
其他win7及win10操作系統(tǒng)
1)、計算機(jī)->管理->本地用戶和組->組 雙擊,效果圖如下:
(2)、雙擊Administrators,并點(diǎn)擊添加,再點(diǎn)擊高級
(3)、把 NETWORK SERVICE添加到Administrators組
1.3 刪除服務(wù)
sc delete mysql57303307
此處記住,重新安裝Mysql就可以,2步操作重新執(zhí)行(刪除原有Mysql文件,全部重新安裝即可)
還有個坑就是,如果還是啟動不了, 記得要開啟這個服務(wù)Windows Installer
Windows Installer是一種通用的軟件發(fā)布方式,用于安裝軟件。
默認(rèn)情況下,該服務(wù)是手動啟動,需要進(jìn)入服務(wù)管理中開啟。
右擊開始——運(yùn)行——輸入“services.msc”——Windows Installer——啟動
2.Winwods安裝初始化報錯
Beginning configuration step: Writing configuration file
Saving 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 rulesBeginning configuration step: Adjusting Windows service
Attempting to grant Network Service require filesystem permissions.
Granted permissions.
Adding new service
New 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即可執(zhí)行既OK
輸入gpedit.msc,打開策略管理
啟用證書更新后正常
由于部分系統(tǒng)鏡像構(gòu)建較早,且不能進(jìn)行系統(tǒng)更新,需要安裝系統(tǒng)補(bǔ)丁包才能完成vc++安裝
3.Centos環(huán)境rpm初始化MySQL報錯
Centos7 默認(rèn)提供的 openssl 版本是 1.0.2 的,某些 php 擴(kuò)展或者其他軟件依賴 1.1 以上版本,如果過低的話就會報錯
libssl.so.1.1: cannot open shared object file: No such file or directory
也有執(zhí)行 openssl version 時報錯和上面一致,這是由于 openssl 庫的位置不正確或未安裝 1.1 以上版本的問題
想要升級 openssl 版本則需要手動進(jìn)行編譯,報錯解決方式很簡單,安裝正確即可,
下面說一下我以 Centos7 為例,說一下具體的編譯安裝步驟
–openssl版本確認(rèn)
[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,來查看一下當(dāng)前 openssl 版本號時,
你會發(fā)現(xiàn)還是 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 驗(yàn)證版本就可以了,
如果不行,可以嘗試下面的方式,
依次執(zhí)行(先備份老版本,再從新版本安裝位置創(chuàng)建軟連接)
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
echo “/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服務(wù):service mysqld restart
4.更改root用戶名
重啟以后,執(zhí)行mysql命令進(jìn)入mysql命令行
5.修改root用戶密碼,此處注意,有時候會報不允許修改,先flush privileges再執(zhí)行即可
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系統(tǒng)下,適用如下方法(全路徑)
G:\mysql-8.0.23-winx64\bin\mysqld --datadir=G:\mysql-8.0.23-winx64\data80323308 --console --skip-grant-tables --shared-memory
然后再開一個窗口,執(zhí)行下面命令
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; --記得刷新哈,如果提示無法創(chuàng)建 mysql> create user root@‘%' identified with mysql_native_password by ‘root'; mysql> grant all on . to root@‘%' with grant option; mysql> flush privileges; mysql> drop user ‘root'@‘localhost'; mysql> flush privileges; mysql> create user root@‘localhost' identified with mysql_native_password by ‘root'; mysql> grant all on . to root@‘localhost' with grant option; mysql> flush privileges;
總結(jié)
到此這篇關(guān)于MySQL安裝常見報錯處理方法的文章就介紹到這了,更多相關(guān)MySQL安裝報錯處理內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
mysql server is running with the --skip-grant-tables option
今天在mysql中新建數(shù)據(jù)庫提示The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement,原來是數(shù)據(jù)中配置的--skip-grant-tables,這樣安全就降低了,這個一般當(dāng)忘記root密碼的時候需要這樣操作2017-07-07windows 64位下MySQL 8.0.15安裝教程圖文詳解
本文通過圖文并茂的形式給大家介紹了MySQL 8.0.15安裝教程(windows 64位),非常不錯,具有一定的參考借鑒價值,需要的朋友可以參考下2019-04-04Mysql在線回收undo表空間實(shí)戰(zhàn)記錄
這篇文章主要給大家介紹了關(guān)于Mysql在線回收undo表空間的相關(guān)資料,文中通過示例代碼介紹的非常詳細(xì),對大家學(xué)習(xí)或者使用Mysql具有一定的參考學(xué)習(xí)價值,需要的朋友們下面來一起學(xué)習(xí)學(xué)習(xí)吧2019-09-09如何恢復(fù)Mysql數(shù)據(jù)庫的詳細(xì)介紹
這里說的MySql恢復(fù)數(shù)據(jù)庫,是指沒有通過正常備份的情況下,通過Mysql保存的數(shù)據(jù)文件如何恢復(fù)數(shù)據(jù)庫2013-09-09