1. 程式人生 > >mysql找回丟失的root密碼

mysql找回丟失的root密碼

 首先,結束掉mysql的服務程序。          在windows下面一是可以通過工作管理員來結束掉,應該是mysql-nt.exe。二是,如果你的mysql註冊為服務的話,可以到服務裡面把他先停掉。          在linux或者unix下面直接kill mysql的服務程序就可以。  然後,再用 --skip-grant-tables 選項啟動mysql服務。           在windows下面,到mysql安裝目錄的bin目錄下面執行:mysql-nt --skip-grant-tables 就可以啟動mysql服務,這樣就可以在無密碼的狀態下進入mysql用mysql -uroot -p           在linux下面 一般mysql伺服器目錄在:/usr/bin/safe_mysqld --skip-grant-tables,執行就可以啟動了。           在Freebsd下面,在/usr/local/etc/rc.d/mysql-server --skip-grant-tables ,執行啟動。           其他的Unix系統沒有研究過。呵呵。 進入mysql以後,執行一下語句:           use mysql           update user set password=password("new_pass") where user="root";           flush privileges; 最後結束掉現在的mysql服務程序,重新啟動你的mysql,就可以用你設定的密碼登入了。

相關推薦

mysql找回丟失root密碼

 首先,結束掉mysql的服務程序。          在windows下面一是可以通過工作管理員來結束掉,應該是mysql-nt.exe。二是,如果你的mysql註冊為服務的話,可以到服務裡面把他先停掉。          在linux或者unix下面直接kill mysq

centos mysql安裝與root密碼找回

1,root 密碼找回 root密碼找回 如果你使用網上的其他安裝教程出現:那麼可以使用我下面的這個連結成功安裝 error: Requires: libstdc++.so.6(GLIBCXX_3.4.15)( 2,安裝 centos 安裝gmysql

MySQL 5.6 root密碼丟失,使用mysqld --skip-grant-tables

進入cmd模式,輸入命令:net stop mysql 停止開機啟動的 mysql services(如果是手動啟動可以跳過Step1,我的pc是開機啟動),我電腦上的mysql services名字是mysql,你的名字可能不一樣!, net stop xxx (xxx代表你的mysql service

記錄下 rhel 7 安裝MySQL 並重置root密碼

load art localhost stop auth flush ring leg databases 註意官方是很不提倡用root的。 下載並安裝MySQL 最新的rpm地址 https://dev.mysql.com/downloads/repo/yum/

linux mysql下忘記root密碼解決辦法

uic linux m star word moni bsp color man ble 1 修改MySQL的登錄設置 # vi /etc/my.cnf 在[mysqld]的中加上一句:skip-grant-tables 2 重新啟動mysqld # /e

ubuntu18安裝mysql遇到的root密碼問題

是我 無法 尼瑪 繼續 windows 用戶 win enc 管理 最近新買了windows筆記本,安裝了ubuntu系統,接下來悲劇發生了。 用命令安裝mysql,默認是5.7(低版本無法用命令安裝),然後就發生了mysql -u root -

CentOS 6系列丟失root密碼解決方案

ima 啟動系統 ebo tro 設置 解決方案 方案 硬盤 ios 法一:使用光盤鏡像 BIOS中設置CD-ROM啟動——選擇救援模式——系統被自動掛載到/mnt/sysimage下——選擇進入shell start shell——進入shell命令行——將/mnt/sy

MySQL 重置 root 密碼 - 忘記密碼

原文地址:https://renguangli.com/articles/mysql-reset-root-password 在配置檔案/etc/my.cnf新增配置,重啟mysql ##無密碼登入 skip-grant-tables; 客戶端連線mysql選

MySQL資料庫設定root密碼

mysqladmin root未設定過密碼 格式:mysqladmin -uroot password 密碼 例子:mysqladmin -uroot password 123 root已設定過密碼 格式:mysqladmin -

mysql 重置root密碼

Stop the MySQL server if it is running. For a server that is running as a Windows service, go to the Services manager: From the Start menu, select Contro

CentOS6.7下MySQL資料庫忘記root密碼解決方法

一、更改my.cnf配置檔案 編輯/etc/my.cnf檔案,在[mysqld]下新增skip-grant-tables,儲存退出。如圖: 重啟mysql服務:services mysqld restart 二、更改root密碼 重啟mysqld服務後,執行mysql命令,

mysql重置root密碼(忘記密碼

關閉許可權驗證 方法一: 執行mysqld_safe --skip-grant-tables & 如果此時不想被遠端連線:mysqld_safe --skip-grant-tables --skip-networking & 方法二: .用命令

MySQL重置root密碼的方法

方法一: 在my.ini的[mysqld]欄位加入: skip-grant-tables 重啟mysql服務,這時的mysql不需要密碼即可登入資料庫 然後進入mysql mysql>use mysql; mysql>更新 update user set password

mysql如何修改root密碼

忘記MySQL ROOT密碼是在MySQ使用中很常見的問題,可是有很多朋友並不會重置ROOT密碼。這時候常會出現:1045-Acess denied for user:'root'@'localhost'(Using password:YES)之類的錯誤。下面轉載的文章說

整理了以下四種在MySQL中修改root密碼的方法,可能對大家有所幫助!

root預設是不支援遠端登入的,用外網連線你必須給許可權呢?GRANT ALL PRIVILEGES ON *.* TO 'username'@' %' IDENTIFIED BY 'password' WITH GRANT OPTION;你先建立一個遠端登入的賬號然後給它遠端登入的許可權 mysql的r

mysql 重設root 密碼

windows: 1、先停止mysql       net stop mysql57 2、修改my.ini      增加 skip-grant-tables 引數 3、啟動mysql      net start mysql57 使用cmd 命令視窗。 執行 mys

Mac MySQL重置Root密碼

申明:本重置密碼可直接對Homebrew安裝的MySQL進行密碼重置,對於其他方式安裝的MySQL需要切換對應的安裝目錄即可。 安裝MySQL後時間太長了會忘記密碼,在這裡總結一下忘記密碼時如

mysql 使用者管理和許可權設定和Mysql初始化root密碼和允許遠端訪問

grant 普通資料使用者,查詢、插入、更新、刪除 資料庫中所有表資料的權利。 grant select on testdb.* to [email protected]’%’ grant insert on testdb.* to [email protected]’%’ grant

mac使用 homebrew 安裝mysql 後 忘記root密碼,重置root密碼

首先確定自己homebrew 安裝的 mysql 的路徑: 我的是: /usr/local/Cellar/mysql/5.7.22 首先輸入 sudo /usr/local/Cellar/mysql/5.7.22/support-files/my

Mysql初始化root密碼和允許遠端訪問(Ⅱ)

1、初始化root密碼 進入mysql資料庫 1 mysql>update user set password=PASSWORD(‘123456’) where User='root'; 2、允許mysql遠端訪問,可以使用以下三種方式: a、改表。 1 2 3