• 修改xampp-mysql密码


    1.进入mysqlin,用mysqladmin命令,格式如下:

    C:xamppmysqlin>mysqladmin -u root -p password newpassword (回车)

    Enter password:oldpassword (回车)

    注释:newpassword为新要设置的密码;

    oldpassword为mysql旧密码;

    附图:

    注:其中123456为新要设置的密码;

    Enter password:旧密码。

    补充:在第一步做完之后,mysql的密码就已经改变,程序必须在代码中设置正确的密码才能连接mysql;

    之后修改xampp附属phpmyadmin的配置文件config.inc.php,只是为了xampp的附属phpmyadmin程序能直接不用输入密码连接mysql。

    如果不使用xampp附属的phpmyadmin,使用纯净版的phpmyadmin,则不需要修改其config.inc.php,只需要在登录时输入正确的用户名和密码就可以正确连接。如:root,123456。

    附图:


    2.

    修改xampp附属的phpmyadmin配置,C:xamppphpMyAdminconfig.inc.php;

    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '123456';
    则在xampp控制面板中点击mysql->admin,然后程序直接进入xampp附属的phpmyadmin,并已经登录。

    附图:


    3.

    如果不使用xampp附属的phpmyadmin,则使用phpmyadmin官方下载的程序,传到网站根目录下,在登录时输入账号,密码,比如root,123456,也可以登录操作mysql数据库。这样做不需要配置 phpmyadmin的配置文件。

    附图:


    4.关于phpmyadmin的登陆配置:

    phpmyadmin的登陆有两种方式,位于配置文件 config.inc.php 中,代码如下:

    /* Authentication type and info */
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '123456';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['AllowNoPassword'] = true;
    $cfg['Lang'] = '';
    
    /* Authentication type */
    //$cfg['Servers'][$i]['auth_type'] = 'cookie';

    以下二者选其一,

    $cfg['Servers'][$i]['auth_type'] = 'config';
    或者
    //$cfg['Servers'][$i]['auth_type'] = 'cookie';

    如果为cookie,则登陆phpmyadmin需要输入账号密码。


    如果为config,则需要配置账号和密码等配置项,然后phpmyadmin不需输入密码直接登陆。

    /* Authentication type and info */
    $cfg['Servers'][$i]['auth_type'] = 'config';
    $cfg['Servers'][$i]['user'] = 'root';
    $cfg['Servers'][$i]['password'] = '123456';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['AllowNoPassword'] = true;
    $cfg['Lang'] = '';

    以上内容均由博主fishli007亲测,请各位看官批评指正。

  • 相关阅读:
    docker基础
    paas平台
    django 多数据分库
    s3对象存储
    css
    __construct()和__initialize()
    js function
    phpstorm ftp 使用
    php
    thinkphp 笔记
  • 原文地址:https://www.cnblogs.com/lifeifei_heyang/p/4291316.html
Copyright © 2020-2023  润新知