本文目錄一覽:
沒有MYSQL服務
你不是伺服器,那麼你的程序應該修改,修改裡面的localhost為伺服器的地址。
現在報錯,是因為程序把你自己的機器當成伺服器進行鏈接,結果失敗,如果不把你的機器安裝為伺服器的話,就只有修改程序鏈接正確的伺服器(而不是本機)。
你的機器沒有MySQL服務,是因為你的機器不是伺服器,當然也可以安裝MySQL以及遊戲配套的程序,把本機變為伺服器。
MySql的服務沒有了,怎麼辦?
你安裝了mysql沒有,沒有就先安裝,安裝好mysql以後,在bin目錄下有個mysqld.exe,運行這個程序就可以添加mysql服務,但是運行這個程序需要使用參數,否則就會以命令行窗口形式啟動mysql資料庫,命令參數如下:
安裝服務(mysql)的命令:
mysqld.exe
–install
可以指定服務的名字,例如:
mysqld.exe
–install
mysql5
以上命令安裝的服務是開機自動運行,如果開機不自動啟動,那麼參數如下:
mysqld.exe
–install-manual
這樣就需要使用下面的命令啟動服務:
net
start
mysql
刪除服務的命令是:
mysqld.exe
–remove
wampserver的mySQL一進入控制台輸入密碼後自動消失
密碼輸入錯誤,所以mysql閃退。我之前輸入root密碼,閃退,然後我試試不輸入密碼,成功登入
MYSQL啟動服務時候一閃就沒有了
解決辦法:
1、碰到這種情況,找到my.ini配置文件
2、找到這一部分
# Installation Instructions
# ———————————————————————-
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option
# “–defaults-file”.
#
# To run run the server from the command line, execute this in a
# command line shell, e.g.
# mysqld –defaults-file=”c:\Program Files\MySQL\MySQL Server X.Y\my.ini”
#
# To install the server as a Windows service manually, execute this in a
# command line shell, e.g.
# mysqld –install MySQLXY –defaults-file=”c:\Program Files\MySQL\MySQL Server X.Y\my.ini”
#
# And then execute this in a command line shell to start the server, e.g.
# net start MySQLXY
#
#
# Guildlines for editing this file
3、如果My.ini實際是在D盤,則將C:改為D: 如下
# Installation Instructions
# ———————————————————————-
#
# On Linux you can copy this file to /etc/my.cnf to set global options,
# mysql-data-dir/my.cnf to set server-specific options
# (@localstatedir@ for this installation) or to
# ~/.my.cnf to set user-specific options.
#
# On Windows you should keep this file in the installation directory
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option
# “–defaults-file”.
#
# To run run the server from the command line, execute this in a
# command line shell, e.g.
# mysqld –defaults-file=”d:\Program Files\MySQL\MySQL Server X.Y\my.ini”
#
# To install the server as a Windows service manually, execute this in a
# command line shell, e.g.
# mysqld –install MySQLXY –defaults-file=”d:\Program Files\MySQL\MySQL Server X.Y\my.ini”
#
# And then execute this in a command line shell to start the server, e.g.
# net start MySQLXY
#
#
# Guildlines for editing this file
原創文章,作者:簡單一點,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/127852.html