本文目錄一覽:
mysql5資料庫服務無法啟動
你是不是安裝過mysql的其它版本?如果是,要卸載,而且卸載之前要先停止系統進程里的mysql服務,再重啟,再安裝新的版本才行。
目前給你提供一點解決辦法供參考
1。打開系統服務進程:右擊我的電腦-管理-服務和應用程序-服務,找到mysql,包括老版本和新版本的,右擊,全部停用
2。卸載已經安裝的MySQL4.1
3。重啟,手動全部刪除舊的安裝文件夾,尤其是windows\my.ini
4。再去看看服務進程里有沒有mysql,如果有,右擊-屬性-啟動類型-禁用
5。安裝新的版本,最好改變安裝路徑。等到出現選擇啟動win服務的下拉框時候,選41的那個就應該能成功了。
mysql 5.1 多實例 怎麼重啟 其中一個實例
用MySQL實例管理器來啟動伺服器。
在這種情況下,Instance Manager的行為取決於MySQL配置文件中的選項。如果沒有配置文件,MySQL實例管理器創建mysqld實例並試圖用默認(編譯嵌入的)配置來啟動。這說明如果mysqld沒有安裝到 默認位置,IM不能猜出它的位置。如果你已經在非標準位置安裝了MySQL伺服器,你應使用配置文件。參見2.1.5節,「安裝布局」。
如果有配置文件,IM將分析配置文件搜索[mysqld]部分(例如[mysqld]、[mysqld1]、[mysqld2]等)。每個部分指定一個實例。啟動時IM將啟動所有找到的實例。IM關閉時默認停止所有實例。
請注意有一個特殊選項mysqld-path(mysqld-path = path-to-mysqld- binary),只能用IM識別。使用該變數讓IM知道mysqld二進位駐留在哪兒。你還應該為伺服器設置basedir和datadir選項。
啟用MySQL實例管理器的典型MySQL伺服器啟動/關閉循環為:
· 用/etc/init.d/mysql腳本啟動MySQL實例管理器。
· MySQL實例管理器啟動所有實例並監視它們。
· 如果某個伺服器實例失敗,MySQL實例管理器重啟它。
· 如果MySQL實例管理器被關閉(例如用/etc/init.d/mysql stop命令),所有實例被MySQL實例管理器關閉。
MySQL:grant 語法詳解(MySQL5.X)
本文實例,運行於MySQL5.0
及以上版本。
MySQL
賦予用戶許可權命令的簡單格式可概括為:
grant
許可權on
資料庫對象to
用戶
一、grant
普通數據用戶,查詢、插入、更新、刪除資料庫中所有表數據的權利。
grant
select
on
testdb.*
to
common_user@’%’
grant
insert
on
testdb.*
to
common_user@’%’
grant
update
on
testdb.*
to
common_user@’%’
grant
delete
on
testdb.*
to
common_user@’%’
或者,用一條MySQL
命令來替代:
grant
select,
insert,
update,
delete
on
testdb.*
to
common_user@’%’
二、grant
資料庫開發人員,創建表、索引、視圖、存儲過程、函數。。。等許可權。
grant
創建、修改、刪除MySQL
數據表結構許可權。
grant
create
on
testdb.*
to
developer@’192.168.0.%’;
grant
alter
on
testdb.*
to
developer@’192.168.0.%’;
grant
drop
on
testdb.*
to
developer@’192.168.0.%’;
grant
操作MySQL
外鍵許可權。
grant
references
on
testdb.*
to
developer@’192.168.0.%’;
grant
操作MySQL
臨時表許可權。
grant
create
temporary
tables
on
testdb.*
to
developer@’192.168.0.%’;
grant
操作MySQL
索引許可權。
grant
index
on
testdb.*
to
developer@’192.168.0.%’;
grant
操作MySQL
視圖、查看視圖源代碼許可權。
grant
create
view
on
testdb.*
to
developer@’192.168.0.%’;
grant
show
view
on
testdb.*
to
developer@’192.168.0.%’;
grant
操作MySQL
存儲過程、函數許可權。
grant
create
routine
on
testdb.*
to
developer@’192.168.0.%’;
—
now,
can
show
procedure
status
grant
alter
routine
on
testdb.*
to
developer@’192.168.0.%’;
—
now,
you
can
drop
a
procedure
grant
execute
on
testdb.*
to
developer@’192.168.0.%’;
三、grant
普通DBA
管理某個MySQL
資料庫的許可權。
grant
all
privileges
on
testdb
to
dba@’localhost’
其中,關鍵字「privileges」
可以省略。
四、grant
高級DBA
管理MySQL
中所有資料庫的許可權。
grant
all
on
*.*
to
dba@’localhost’
五、MySQLgrant
許可權,分別可以作用在多個層次上。
1.
grant
作用在整個MySQL
伺服器上:
grant
select
on
*.*
to
dba@localhost;
—
dba
可以查詢MySQL
中所有資料庫中的表。
grant
all
on
*.*
to
dba@localhost;
—
dba
可以管理MySQL
中的所有資料庫
2.
grant
作用在單個資料庫上:
grant
select
on
testdb.*
to
dba@localhost;
—
dba
可以查詢testdb
中的表。
3.
grant
作用在單個數據表上:
grant
select,
insert,
update,
delete
on
testdb.orders
to
dba@localhost;
4.
grant
作用在表中的列上:
grant
select(id,
se,
rank)
on
testdb.apache_log
to
dba@localhost;
5.
grant
作用在存儲過程、函數上:
grant
execute
on
procedure
testdb.pr_add
to
‘dba’@’localhost’
grant
execute
on
function
testdb.fn_add
to
‘dba’@’localhost’
六、查看MySQL
用戶許可權
查看當前用戶(自己)許可權:
show
grants;
查看其他MySQL
用戶許可權:
show
grants
for
dba@localhost;
七、撤銷已經賦予給MySQL
用戶許可權的許可權。
revoke
跟grant
的語法差不多,只需要把關鍵字「to」
換成「from」
即可:
grant
all
on
*.*
to
dba@localhost;
revoke
all
on
*.*
from
dba@localhost;
八、MySQLgrant、revoke
用戶許可權注意事項
1.
grant,
revoke
用戶許可權後,該用戶只有重新連接MySQL
資料庫,許可權才能生效。
2.
如果想讓授權的用戶,也可以將這些許可權grant
給其他用戶,需要選項「grant
option「
grant
select
on
testdb.*
to
dba@localhost
with
grant
option;
這個特性一般用不到。實際中,資料庫許可權最好由DBA
來統一管理。
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/192815.html