Error in connecting to database

Kindly help. What is the meaning of this following error while running matching_surface.csh and how do I resolve this.

Matching WRF output file with observations: /mnt/ntfs/Users/Home/Downloads/wrfout_subset_2016-07-01_00_00_00
Creating new database if it does not exist: CREATE DATABASE IF NOT EXISTS user_database ;
Error in .local(drv, …) :
Failed to connect to database: Error: Access denied for user ‘amet’@‘localhost’ (using password: YES)
Calls: new_dbase_tables -> dbConnect -> dbConnect -> .local -> .Call
Execution halted
Date/Time END

Thanks and regards.

Hi Indumati,

This error occurs because AMET is not able to create the required MySQL database using the provided username and password during setup. First, you should check to see that you have a MySQL username and password. Based on the error, it appears that AMET is trying to connect to the database using the default username ‘amet’ to the MySQL server called ‘localhost’, which makes me think you have not updated the database username and password from the default Github code (although that may not be the case if you created a username called ‘amet’). You should also update localhost to be the name of your MySQL server, although localhost will work in some instances.

There are instructions in the AMET documentation on where to specify the database username/password and MySQL server name. Whomever installed the MySQL database should be able to provide you a username and password that you can use for AMET.

If you already have a working login to the database, then you probably just need to update the AMET config files with it. The AMET documentation describes how to do this.

If none of those solutions work for you, please let us know. Thanks.

Wyat

1 Like

Hi Wyat,

I’m facing a similar issue while populating my database.

We configured both the MySQL root and Amet users without passwords and kept the database user info in amet-config.R, similar the default GitHub code. It seems that I was be able in creating the “amet” database for the “ametsecure” user using the “create_amet_user.csh” script. I can log on and retrieve the list of all tables in my database:
±---------------+
| Tables_in_amet |
±---------------+
| aqExample |
| aq_project_log |
| project_units |
| site_metadata |
±---------------+
4 rows in set (0.000 sec)

But during the database population, an access denied message is happend with the following details:

• Project_ID: IMPROVE
• Network: /data/amet/AMET_v15/output/aqExample/sitex_output/201607/IMPROVE_aqExample.csv
• Sitex File: NA
• MySQL Server: localhost
The error message received is:
Error in .local(drv, …) :
Failed to connect to the database: Error: Access denied for user ‘ametsecure’@‘localhost’ (using password: YES)
Calls: dbConnect → dbConnect → .local → .Call
Execution halted
Finished populating the database for network IMPROVE

I would appreciate your insights on it. I am also wondering to know how I can configure the script to do database population without requiring a password. I was able to run aqProject.csh and make plots for monthly evaluation without the use of the database.

Thanks,

Azimeh,

One thing you could try first is to specify the database you’re trying to connect to (i.e., amet) by name instead of using ‘localhost’ in the amet-config.R file.

##::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

MySQL Configuration

The AMET user info provided here must have database write permission if used in the aqProject.csh and/or metProject.csh scripts

Otherwise, if just used for the analysis side of AMET, database read permission only is sufficient

mysql_server ← “localhost” ## Name of MYSQL server
amet_login ← “ametsecure” ## AMET Root login for MYSQL serve
amet_pass ← “xxxxxxxxxx” ## AMET Root password for MYSQL server
maxrec ← -1 ## Set MySQL maximum records for queries (-1 for no maximum)

##::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

I believe localhost should work, but it’s a place to start. Also, are just trying to run the script in the command line, or are you submitting to a queuing system? Submitting to a queue that uses process nodes could possible be an issue, but I suspect that’s probably not what you’re doing.

Liz Adams may also have some insight to provide here. I’ll reach out to her as well.

Wyat