phpmyadmin用root用户登录 MariaDB 10.1.26 (mysql 5.7) 失败
环境:Debian 9.4, MariaDB 10.1.26 或 mysql 5.7, phpmyamdin 4.8
过程:
- 在Debian系统里安装好 nginx + php7.0 + MariaDB 的环境,放置一份 phpmyadmin 尝试登录
- 用 MariaDB 的root用户和密码登录,失败,提示:
>mysqli_real_connect(): (HY000/1698): Access denied for user 'root'@'localhost'>mysqli_real_connect(): (HY000/1698): Access denied for user 'root'@'localhost'
- 搜索得,如 mysql 5.7 版本后,默认不允许root用户从如phpmyadmin登录
- 可在服务器里通过mysql,创建一个有完全权限的新用户,如果是生产环境,建议仅授权指定数据库的权限:
`CREATE USER 'idbadm'@'localhost' IDENTIFIED BY 'meizi36829';` `GRANT ALL PRIVILEGES ON *.* TO 'idbadm'@'localhost' WITH GRANT OPTION;` `FLUSH PRIVILEGES;`
- 用新建用户的信息(登录名idbadm,密码meizi36829),再次登录phpmyadmin,成功
参考:
- https://askubuntu.com/questions/763336/cannot-enter-phpmyadmin-as-root-mysql-5-7
- https://zenidas.wordpress.com/recipes/mysql-5-7-root-login-without-sudo/
标签: phpmyadmin
2 Comments
Davidoff · 2020-11-06 at 00:24
여러버전의 php동시 설치할려면 아래와같이 입력..
/.install.php mphp
Davidoff · 2020-11-06 at 21:35
nginx 에 새로운 모듈 추가할려면 lnmp1.X다이렉트에서 lnmp.conf편집하고 ./upgrade.sh실행 -> nginx선택 -> 실행하면 됩니다..
예:nginx에 ssl_preread , realip_module 모듈 첨가시- lnmp.conf편집:
Nginx_Modules_Options='--with-stream_ssl_preread_module --with-http_realip_module'