Preloader
Web development
  • Estimated reading time: 1 Minute

How to login as root (admin) user in the MySQL CLI with Plesk

How to login as root (admin) user in the MySQL CLI with Plesk

Someone that has worked with the MySQL CLI knows how easy it is to access all databases on the server with the following command:

mysql -u root -p password

However, trying to do the same on plesk will fail basically because you will probably don't know what's the password to access MySQL. In this article we'll show you how to login as root/admin.

Logging in as admin in MySQL with Plesk

To login as admin (or root) to MySQL through the CLI in a server with Plesk you can use the following command:

MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin

What we are basically doing is to access as admin, the user that has all privileges to execute any query that you need with the encrypted password stored in the .psa.shadow file of Plesk. For more information about how to access to the MySQL CLI in Plesk, check the official article of Plesk here.

Happy coding !

Share:
Carlos Delgado

Carlos Delgado

Senior Software Engineer at Corvix. Interested in programming since he was 14 years old, Carlos is a self-taught programmer and founder and author of most of the articles at Our Code World.

Related articles
The Convergence of AI, Cybersecurity & Modern Web Development | OST
16 Jun, 2026
  • Estimated reading time: 4 Minutes
WordPress vs Custom Website: Which is Better for Your Business?
23 Apr, 2026
  • Estimated reading time: 5 Minutes
Guidelines To Follow In Test Case Writing
4 Mar, 2026
  • Estimated reading time: 4 Minutes
How to Build a Secure Authentication System in a Web Application
27 Feb, 2026
  • Estimated reading time: 5 Minutes
Weekly trending
AI SEO Malaysia: Google AI Overviews for Corporates
1 Jul, 2026
  • Estimated reading time: 7 Minutes
Types of Hoodie Material: A Complete Fabric Guide
1 Jul, 2026
  • Estimated reading time: 4 Minutes
PWA vs Capacitor vs Native: Choosing an App Architecture in 2026
1 Jul, 2026
  • Estimated reading time: 4 Minutes
Key Features of Premier Contact Point Explained Simply
1 Jul, 2026
  • Estimated reading time: 7 Minutes
Our Sponsors

Our blog is proudly supported by industry-leading sponsors.