java.sql.SQLSyntaxErrorException: Access was denied to the user in MySQL 8.4.

 java.sql.SQLSyntaxErrorException: Access denied for user 'SIT'@'%' to database 'SIT'

means the MySQL user SIT does not have sufficient privileges on the database SIT.


Here’s how you can fix it in MySQL 8.4:

Step 1: Log in as a privileged user

Connect with root or another admin account:

root > mysql -u root -p

Step 2: Check if the user SIT exists

mysql> SELECT user, host FROM mysql.user WHERE user='SIT';

If no row is returned, create the user:

CREATE USER 'SIT'@'%' IDENTIFIED BY 'your_password';

Step 3: Grant privileges on the database

Give the user access to the SIT database:

mysql> GRANT ALL PRIVILEGES ON SIT.* TO 'SIT'@'%';

Or if you want only read/write:

mysql> GRANT SELECT, INSERT, UPDATE, DELETE ON SIT.* TO 'SIT'@'%';

Step 4: Apply changes

mysql> FLUSH PRIVILEGES;

Step 5: Test the connection

From your Java app or CLI:

# mysql -u SIT -p -h <your_host> SIT

Query to get the package specification

In Oracle E-Business Suite R12.2.10, if you want to download (export) a package’s source code (specification and body), you can do it using a SQL query in TOAD, SQL Developer, or any other tool connected to the APPS schema.

 ## Query to get the package specification

sql > SELECT text

FROM all_source

WHERE name = UPPER('PACKAGE_NAME')

  AND type = 'PACKAGE'

ORDER BY line;


##Query to get the package body

sql > SELECT text

FROM all_source

WHERE name = UPPER('PACKAGE_NAME')

  AND type = 'PACKAGE BODY'

ORDER BY line;


In Oracle EBS R12.2.10, fetching a custom package (specification or body) is usually done directly from the APPS schema or from the Edition-Based Redefinition (EBR) filesystem if you want the file from the application tier.

# View Package Specification

SELECT text

FROM all_source

WHERE name = 'YOUR_PACKAGE_NAME'

  AND type = 'PACKAGE'

  AND owner = 'APPS'

ORDER BY line;


# View Package Body

SELECT text

FROM all_source

WHERE name = 'YOUR_PACKAGE_NAME'

  AND type = 'PACKAGE BODY'

  AND owner = 'APPS'

ORDER BY line;


java.sql.SQLSyntaxErrorException: Access was denied to the user in MySQL 8.4.

 java.sql.SQLSyntaxErrorException: Access denied for user 'SIT'@'%' to database 'SIT' means the MySQL user SIT does ...