文章詳情頁(yè)
MySQL 的日常使用
瀏覽:6日期: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ù)庫(kù)
相關(guān)文章:
1. 有時(shí)Oracle不用索引來查找數(shù)據(jù)的原因2. MySQL 編碼utf8 與 utf8mb4 utf8mb4_unicode_ci 與 utf8mb4_general_ci3. Centos7 下mysql重新啟動(dòng)MariaDB篇4. sql server 2005中的表分區(qū)5. 使用DB2look 重新創(chuàng)建優(yōu)化器訪問計(jì)劃(3)(1)6. MariaDB的安裝與配置教程7. MySQL之高可用集群部署及故障切換實(shí)現(xiàn)8. 詳解mysql的備份與恢復(fù)9. 利用sql server 2005數(shù)據(jù)庫(kù)郵件發(fā)送電子郵件10. sql server添加唯一性約束的方法步驟
排行榜
