How to access Plesk database?

Created:

2016-11-16 12:59:36 UTC

Modified:

2017-04-24 11:03:50 UTC

7

Was this article helpful?


Have more questions?

Submit a request

How to access Plesk database?

Applicable to:

  • Plesk

Question

How to access Plesk database?

Answer

On Linux

On Plesk 11.5 and newer, use this command shortcut in all cases:

  • To access Plesk database:

    # plesk db
  • To make query in Plesk database from command line:

    # plesk db "select * from misc"

On Plesk 11.0 and below use the following way:

  • To access Plesk database:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa
  • To make query in Plesk database from command line:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e "select * from misc"

This will make your login secure.

On Windows

To run a single query to the Plesk database, ' dbclient ' utility may be used:

C:\> "%plesk_bin%\dbclient" --direct-sql --sql="select * from misc"

Note : Only UPDATE and SELECT queries are supported by dbclient . Also complex queries, e.g. embedded selects, may work incorrectly.

For complex queries it is recommended to log in to the Parallels Plesk database directly. It can be accessed using the following steps, depending on the database provider configured on the current installation.

  • MySQL database provider:

    Execute the following commands in the command prompt:

    "%plesk_dir%\MySQL\bin\mysql" -P8306 -uadmin -p psa

    Since Plesk 12.5 the shortcut command is available:

    C:\> plesk db
  • MS SQL database provider:

    The database can be accessed using the following CLI command:

    C:\Program Files\Microsoft SQL Server\80\Tools\Binn\osql –E

    Alternatively, the Microsoft SQL Server Management Studio Express utility can be used.

  • Jet database provider (MS Access):

    Database file is located at %plesk_dir%\admin\db\psa.mdb . Any utility for viewing MS Access (.mdb) database files may be used. For example:

    http://www.alexnolan.net/software/mdb_viewer_plus.htm

    http://www.softpedia.com/get/Internet/Servers/Database-Utils/MDB-View.shtml

Have more questions? Submit a request
Please sign in to leave a comment.