文章詳情頁
MySQL 的日常使用
瀏覽:17日期:2023-10-16 17:51:30
*nix os 下配置文件一般存放位置
Default options are read from the following files in the given order: /etc/my.cnf, /etc/mysql/my.cnf, /usr/local/etc/my.cnf, ~/.my.cnf
默認(rèn)設(shè)置按一下順序讀取:
/etc/my.cnf, /etc/mysql/my.cnf, /usr/local/etc/my.cnf, ~/.my.cnf
Ubuntu 下的啟動(dòng),停止與重啟啟動(dòng)方式:
方式一:sudo /etc/init.d/mysql start方式二:sudo start mysql方式三:sudo service mysql start停止mysql:
方式一:sudo /etc/init.d/mysql stop方式二:sudo stop mysql方式三:sudo service mysql stop重啟mysql:
方式一:sudo/etc/init.d/mysql restart方式二:sudo restart mysql方式三:sudo service mysql restartMac 下的啟動(dòng),停止與重啟這里記錄通過 homebrew 安裝的操作
啟動(dòng): mysql.server start停止: mysql.server stop重啟: mysql.server restart 或者 reload 或者 force-reload### 權(quán)限管理 查看mysql狀態(tài)
方式一:service mysql status (輸出類似mysql start/running, process 810)方式二:登錄mysql client, 執(zhí)行命令:show status;方式三:Mac 如果是通過 homebrew 安裝的,則可以直接使用 mysql.server status查看增加用戶及權(quán)限
GRANT ALL ON *.* TO ’username’@’hostname’ IDENTIFIED BY ’username’ WITH GRANT OPTION; # 然后刷新權(quán)限 flush privileges;
刪除用戶權(quán)限
REVOKE ALL ON *.* FROM ’username’@’hostname’; # 然后刷新權(quán)限 flush privileges;
標(biāo)簽:
MySQL
數(shù)據(jù)庫
相關(guān)文章:
1. MySQL分區(qū)的優(yōu)點(diǎn)2. mysql的like模式3. mysql-bin.000001文件的來源及處理方法4. MYSQL(電話號(hào)碼,身份證)數(shù)據(jù)脫敏的實(shí)現(xiàn)5. MySQL 字符串函數(shù):字符串截取6. 加密你的Access數(shù)據(jù)庫asp打開方法7. mysql like語句問題8. Oracle根據(jù)逗號(hào)拆分字段內(nèi)容轉(zhuǎn)成多行的函數(shù)說明9. 什么是Access數(shù)據(jù)庫10. 如何實(shí)現(xiàn)MySQL數(shù)據(jù)庫的備份與恢復(fù)
排行榜

網(wǎng)公網(wǎng)安備