更多>>PHP程序设计

使用wamp安装PHP时更改mysql的默认密码

安装PHP环境时,如果你使用wamp集成环境安装包来安装的话,安装完后,如何更改mysql的默认密码呢?

     

1、将wamp由默认的英文版切换成中文版

左键单击桌面右下角的wamp图标 - language - chinese


2、更新mysql数据库的密码
默认情况下,mysql数据库的用户名为root,密码为空。相应的,进入phpmyadmin时,在地址栏中直接输入 localhost/phpmyadmin/ 便可进入。
(1)右键单击桌面右下角的wamp图标 - MySQL - MySQL 控制台(M)

(2)此时,无需输入密码,按下回车键即可进入。

(3)接着输入如下命令:
use mysql
表示使用mysql这个数据库,按下回车键,出现 Database changed 。

(4)接着输入如下更新命令:
update user set password = password('root') where user = 'root';
表示把密码更新为root, 按下回车键,屏幕会输出 Query OK, 3 rows affected。
(5)接着输入如下命令:
flush privileges;
表示刷新权限,按下回车键,屏幕会输出 Query OK, 0 rows affected。

(6)接着输入 quit ,按下回车键,表示退出控制台。
此时,再进入mysql控制台,就需要输入密码才能进入了,但是,在地址栏中直接输入 localhost/phpmyadmin/ 你会发现进不去了,更新了mysql数据库的密码后,同时还需要更新phpmyadmin的相关配置才能访问。

3、更新phpmyadmin的相关配置
(1)进入wamp安装的根目录,找到phpmyadmin下的 config.ini.php 文件,如 /wamp/apps/phpmyadmin4.1.14/config.ini.php
(2)找到这行代码:$cfg['Servers'][$i]['password'] = ''; 将其更新为mysql数据库的新密码,如 $cfg['Servers'][$i]['password'] = 'root';
此时,在地址栏中直接输入 localhost/phpmyadmin/ 便可进入了。
(3)想要进入phpmyadmin时,以输入用户名和密码的方式进入。找到如下代码:
//$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['auth_type'] = 'config';
更新为:
$cfg['Servers'][$i]['auth_type'] = 'cookie';
//$cfg['Servers'][$i]['auth_type'] = 'config';
表示,以cookie方式登录phpmyadmin。

此时,在地址栏中直接输入 localhost/phpmyadmin/ 便需要输入用户名和密码才能进入了。


(重新启动wamp,配置完毕)

评论列表

no_photo

Tukash, Ramirez, Tjalf and Bas

Advances in technology take allowed looking for improved monitoring of children in community settings and at placid, as articulately as allowing elaborate procedures, such as intra...

2018-03-30 05:48:11

no_photo

Сантехник в Нижнем Новгороде

http://xn--52-6kcaysovb0bn1b.xn--p1ai - мастер на час

2018-03-28 02:56:18

no_photo

lighten your teeth right now w

kigtropin side effects Look at moving the modification away from your banking account every single day, and relocating it for your bank account. It is a tiny modify you won't ove...

2018-03-25 00:54:26

no_photo

Locksmith Service

locksmith service, locksmith near me, locksmith. locksmithservice, auto locksmith, emergency locksmith http://locksmithservice.us.com - locksmiths!..

2018-03-24 22:46:29

no_photo

Get an essay or any other home

Running late with the deadline for your work? Then we are your reliable assistant in paper help. Get ready to ask for our assistance when you need essays, research or course w...

2018-03-18 08:32:03

no_photo

trazodone for sleep 50 mg Pibr

pastillas trazodone y alcoho trazodone generico en mexico only best offers 100mg trazodone enter site natural trazodone only now trazodone 20 mg price trazodone per pill click here...

2018-03-18 02:49:54

no_photo

Стоимость вышки-туры

Вам будет интересно как где и сколько стоят леса, схема проезда и многое другое: вышка тура спб и строительные леса купить с доставкой

2018-03-17 14:52:59

no_photo

hello google

Hello. And Bye.

2018-03-17 07:17:58


管理员回复

Thank you for coming. Please come again.

2018-03-20

no_photo

фото домов и коттеджей

Строительство, Екатеринбург Кровля, Екатеринбург Красивые пластиковые окна Палкино, Екатеринбург Установить Натяжные потолки Горнозаводский, Екатеринбург Современные натяжные п...

2018-03-16 16:16:47

no_photo

precios de cialis generico

Really lots of valuable knowledge. click here take cialis cialis kaufen cialis reviews cialis prices in england order generic cialis online cialis usa cost cialis online deu...

2018-03-15 16:43:04

发表评论

用来接收审核回复提醒,请认真填写

captcha
看不清?点击图片换一张