How to Logon to MySQL

  • 7019209
  • 24-Mar-2015
  • 07-Aug-2017




I have read some Retain KB articles that mention running MySQL scripts.  How do I logon to MySQL?


This knowledgebase (KB) article is provided for informational purposes only and as a courtesy service to you, our customer. GWAVA Technical Support does not have any database administration (DBA) expertise, nor does it provide DBA services or support. GWAVA is not responsible for the results of implementing any of the concepts contained in this KB article. Implementation of any of the concepts suggested in this KB article shall be done entirely at your own and sole risk, and GWAVA does not provide any kind of warranties whatsoever resulting from your decision of implementing any of the KB article’s concepts. It is up to you to do any research and to ensure yourself that any implementation and setup of any of the KB article’s concepts in your database system is correctly and properly executed. It is imperative that you have backups of your database system and storage directory before making any implementation. If you don’t have any DBA expertise, you should consult with a DBA expert before any implementation of the KB article’s concepts.  Under no circumstances, shall GWAVA, or any of its employees, be liable, in contract, tort, delict or otherwise, whether negligence is provable or not, for any direct, indirect, incidental, special, punitive, consequential or other damages, loss, cost or liability whatsoever that would result from or are related to the implementation of any of the concepts suggested in the KB article.

To the extent permitted by applicable law, GWAVA shall not be liable to you for any special, consequential, direct, indirect or similar damages, including any loss of data, arising out from migrating any type of messages, attachments, database, metadata in your Retain system to another server and/or location.


The MySQL login is done from a command prompt in a terminal window (Linux) or from a command window (Windows).  You first need to know your database username that Retain is using.  Logon to the Retain web administration console as the "admin" user or a user with admin rights.  Click on Server Configuration | Communications.  Look at the field "Database User Account".

You also need to know that account's password.  Most customers store this information somewhere.  If you do not know it, you can get it from the ASConfig.cfg found in ../retain/RetainServer/WEB-INF/cfg.  The file is in XML format.  Look for "<DBPass>"


Open a terminal window or a PuTTY session to the server where MySQL is running.

Type:  mysql -u [retain database username] -p [ENTER]

Example:  mysql -u retain -p [ENTER]


  1. Open a command window on the server where MySQL is running.
  2. If the MySQL bin directory was added to your path during its installation (selectable option), all you should have to do is type:  mysql -u [retain database username] -p [ENTER] ;otherwise, if not in the path, you'll need to change to the [MySQL program directory]\Bin directory before running the command.

Example:  mysql -u retain -p [ENTER]

Once you have a successful login, type: use [retain database name] [ENTER]

Example:  use retain [ENTER]

If you do not know the name of your Retain database, you can type: show databases;

Then, you can issue the "use" command to switch to your Retain database.  You can also get the Retain database name from the Retain web administration console in the same location where it specifies the database user account (mentioned earlier in this article).

Now you are ready to query the Retain database.

Additional Information

This article was originally published in the GWAVA knowledgebase as article ID 2504.