使用MySQL CLI的人都知道使用以下命令来访问服务器上的所有数据库是多么容易:
mysql -u root -p password
但是, 尝试在plesk上执行相同操作基本上会失败, 因为你可能不知道访问MySQL的密码是什么。在本文中, 我们将向你展示如何以root / admin身份登录。
使用Plesk在MySQL中以管理员身份登录
要在具有Plesk的服务器上通过CLI以admin(或root)身份通过MySQL登录, 可以使用以下命令:
MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin
我们基本要做的是以admin身份访问, 该用户具有使用存储在Plesk的.psa.shadow文件中的加密密码来执行所需查询的所有特权。有关如何在Plesk中访问MySQL CLI的更多信息, 请在此处查看Plesk的官方文章。
编码愉快!
微信公众号
手机浏览(小程序)
Warning: get_headers(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(): Failed to enable crypto in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57
Warning: get_headers(https://static.shanhubei.com/qrcode/qrcode_viewid_45880.jpg): failed to open stream: operation failed in
/mydata/web/wwwshanhubei/web/wp-content/themes/shanhuke/single.php on line
57