phpmyadmin默认用户名密码及密码修改 | 您所在的位置:网站首页 › 腾讯云账户名 › phpmyadmin默认用户名密码及密码修改 |
一、一般默认情况 搭建本地网站的phpstudy软件,点击进入管理MYSQL数据库一般情况下: 本地的phpmyadmin用户名是:root 密码为:root 或为空 (一般如果PhpMyAdmin跟空间位于同一主机下的话,大部分用户名跟密码是共用的,也就是空间的用户名跟密码与PhpMyAdmin的是同一个,如果是在不同的主机下的话,可能就不同了。) 二、直接更改 1、my.ini里面找到mysqld配置项 [mysqld] port=3306 下面添加 skip-grant-tables 之后可跳过密码输入 进入命令端 2、之后更改密码 输入:update mysql.user set password=password("新密码") where user=root; 3、改完密码后,删除my.ini里面添加的 skip-grant-tables 就可以了 三、phpmyadmin不需要密码登录的设置方法 : 下了最新版的phpmyadmin,装上后输入用户名root然后点登录,因为我在本地,所以root没有密码,结果老是报访问被拒绝的错误. $cfg['Servers'][$i]['AllowNoPasswordRoot'] = false; 我想这可能是他为了安全着想吧,让人一定设root密码,呵呵,不过我认为在测试的时候有点不方便,一般本地的root用户都是空的. 其实他可以把提示语句改下,说是你的root密码为空,以当前的安全级别不允许登录,可以到XXX地方把设置改过来,这样可能会明白些,单一个访问被拒绝太难找原因了. 同时将代码如下: 设置数据库教程连接密码设为空密码,即告成功. 四、PHP设置phpMyAdmin设置登录密码 phpMyAdmin直接与MYSQL相连,因此安全性来说非常关键,有的朋友为了图方便,根本没有为phpMyAdmin设置一个登录密码,这样很危险,若这个地址被别人知道,那你的MYSQL就完了。所以为了安全起见,我们还是要为phpMyAdmin设置一个密码,一般情况下,这个密码是和MYSQL密码是一致的,默认状态下,phpMyAdmin没有开启让登录再进入的功能,我们可以通过以下代码开启这项功能: 这里的参数有三种,cookie是其中之一,其中还有两个参数是config和http,config的意思是: 按配置文件中的密码 (也就是标准方式) 这种方式没有认证;http : 使用HTTP认证;cookie : 使用COOKIE登录认证。如果是使用IIS+PHP的方式,则HTTP认证是无效的,这个功能只能在APACHE服务器环境下使用。一般情况下,都是使用的COOKIE方式。 五、 /* vim: set expandtab sw=4 ts=4 sts=4: */ /** * phpMyAdmin sample configuration, you can use it as base for * manual configuration. For easier setup you can use setup/ * * All directives are explained in Documentation.html and on phpMyAdmin * * @version $Id$ * @package phpMyAdmin */ /* * This is needed for cookie based authentication to encrypt password in * cookie */ $cfg['blowfish_secret'] = ''; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */ /* * Servers configuration */ $i = 0; /* * First server */ $i++; /* Authentication type */ $cfg['Servers'][$i]['auth_type'] = 'cookie'; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'SQL主机'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = SQL用户名; /* Select mysqli if your server has it */ $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['AllowNoPassword'] = SQL密码; /* rajk - for blobstreaming */ $cfg['Servers'][$i]['bs_garbage_threshold'] = 50; $cfg['Servers'][$i]['bs_repository_threshold'] = '32M'; $cfg['Servers'][$i]['bs_temp_blob_timeout'] = 600; $cfg['Servers'][$i]['bs_temp_log_threshold'] = '32M'; /* User for advanced features */ // $cfg['Servers'][$i]['controluser'] = 'pma'; // $cfg['Servers'][$i]['controlpass'] = 'pmapass'; /* Advanced phpMyAdmin features */ // $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin'; // $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark'; // $cfg['Servers'][$i]['relation'] = 'pma_relation'; // $cfg['Servers'][$i]['table_info'] = 'pma_table_info'; // $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords'; // $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages'; // $cfg['Servers'][$i]['column_info'] = 'pma_column_info'; // $cfg['Servers'][$i]['history'] = 'pma_history'; // $cfg['Servers'][$i]['tracking'] = 'pma_tracking'; // $cfg['Servers'][$i]['designer_coords'] = 'pma_designer_coords'; /* Contrib / Swekey authentication */ // $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf'; /* * End of servers configuration */ /* * Directories for saving/loading files from server */ $cfg['UploadDir'] = ''; $cfg['SaveDir'] = ''; ?> |
CopyRight 2018-2019 实验室设备网 版权所有 |