国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數據庫 > MySQL > 正文

在ubuntu中重置mysql服務器root密碼的方法

2020-01-18 23:57:29
字體:
來源:轉載
供稿:網友
首先停止mysql服務:
復制代碼 代碼如下:

root@webserver:/home/webmaster# service mysql stop

接著采用忽略密碼認證模式重新創建一個mysql服務:
復制代碼 代碼如下:

root@webserver:/home/webmaster# mysqld --user=mysql --skip-grant-tables --skip-networking &

成功啟動后返回PID及其它啟動信息
復制代碼 代碼如下:

[1] 3591
root@webserver:/home/webmaster# 121005 2:59:27 [Note] Plugin 'FEDERATED' is disabled.
121005 2:59:27 InnoDB: The InnoDB memory heap is disabled
121005 2:59:27 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121005 2:59:27 InnoDB: Compressed tables use zlib 1.2.3.4
121005 2:59:27 InnoDB: Initializing buffer pool, size = 128.0M
121005 2:59:27 InnoDB: Completed initialization of buffer pool
121005 2:59:27 InnoDB: highest supported file format is Barracuda.
121005 2:59:27 InnoDB: Waiting for the background threads to start
121005 2:59:28 InnoDB: 1.1.8 started; log sequence number 1595685
121005 2:59:28 [Note] mysqld: ready for connections.
Version: '5.5.24-0ubuntu0.12.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 0 (Ubuntu)

連接到mysql系統庫:
復制代碼 代碼如下:

root@webserver:/home/webmaster# mysql -u root mysql

連接到mysql庫后直接修改root帳號的密碼為新的密碼'mynewpasswd':
復制代碼 代碼如下:

Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.

mysql> update user set Password=PASSWORD('mynewpasswd') where user='root';
Query OK, 3 rows affected (0.00 sec)
Rows matched: 3 Changed: 3 Warnings: 0

mysql> FLUSH PRIVILEGES;
mysql> quit;
Bye

中止mysql服務進程(PID 3591見前面啟動服務時的屏幕信息):
復制代碼 代碼如下:

root@webserver:/home/webmaster# kill 3591

正常啟動 mysql服務,并用新密碼登錄mysql服務器成功:
復制代碼 代碼如下:

root@webserver:/home/webmaster#service mysql start
root@webserver:/home/webmaster#mysql -u root -pmynewpasswd
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 泾川县| 盘锦市| 永康市| 丰县| 无极县| 沛县| 本溪| 平江县| 嘉荫县| 廉江市| 新巴尔虎右旗| 邛崃市| 手机| 龙川县| 枣阳市| 黑龙江省| 靖州| 闽侯县| 青海省| 宜阳县| 宽甸| 高平市| 西林县| 辽中县| 黄山市| 宜兰市| 溧阳市| 宜兴市| 象山县| 云和县| 天峨县| 辽源市| 延津县| 图们市| 南平市| 阿坝县| 肃北| 称多县| 桐梓县| 加查县| 酉阳|