You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Debian测试版(接近9)中phpMyAdmin初始用户密码设置求助

Fixing phpMyAdmin Login Credentials on Debian (Near Version 9)

Hey there! Let's get you logged into phpMyAdmin smoothly. The login credentials it's asking for are tied to your MySQL Server user accounts—either the root account you set up during installation, or a dedicated user you can create for phpMyAdmin access. Here's a step-by-step breakdown:

1. Use Your Existing MySQL Root Account (Quick Fix)

First, try using the MySQL root username (root) and the password you set when installing MySQL Server. If you can't remember the root password, or if root isn't accessible via phpMyAdmin (common on Debian due to default socket authentication), follow these steps to reset/enable password login for root:

  • Open your terminal and log into MySQL via the socket (this works without a password on Debian's default setup):
    sudo mysql -u root
  • Once in the MySQL shell, update the root account to use password authentication:
    ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your_new_strong_root_password';
    FLUSH PRIVILEGES;
    
  • Exit the shell with exit;, then try logging into phpMyAdmin with root and the password you just set.

2. Create a Dedicated phpMyAdmin User (More Secure)

For better security, it's recommended to create a separate user with limited permissions for phpMyAdmin. Here's how:

  • Log into the MySQL shell (using the root account you just fixed, or sudo mysql -u root if still using socket auth):
    sudo mysql -u root -p
  • Run these SQL commands to create and configure the user (replace pma_user and your_secure_password with your preferred values):
    -- Create the user
    CREATE USER 'pma_user'@'localhost' IDENTIFIED BY 'your_secure_password';
    -- Grant necessary permissions (adjust if you want to restrict access to specific databases)
    GRANT ALL PRIVILEGES ON *.* TO 'pma_user'@'localhost' WITH GRANT OPTION;
    -- Apply the changes
    FLUSH PRIVILEGES;
    
  • Exit the shell and use this new username/password to log into phpMyAdmin.

3. Verify phpMyAdmin Configuration (If Issues Persist)

If you're still having trouble, check the phpMyAdmin config file to ensure it's set to use cookie-based authentication (the default, which prompts for credentials):

  • Open the config file in a text editor:
    sudo nano /etc/phpmyadmin/config.inc.php
  • Look for the line starting with $cfg['Servers'][$i]['auth_type']—it should be set to 'cookie':
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
  • Save the file (Ctrl+O, then Enter) and exit (Ctrl+X), then restart Apache to apply changes:
    sudo systemctl restart apache2

That should get you logged into phpMyAdmin without issues!

内容的提问来源于stack exchange,提问作者ckosloff

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.26 08:54:30