[oracle] Oracle ORA-12154: TNS: Could not resolve service name Error?

This was mentioned in a comment to another answer, but I wanted to move it to an actual answer since this was also the problem in my case and I would have upvoted it if it had been an answer.

I'm on Linux and the tnsnames.ora file was not set to readable by everyone. After making it readable connecting via tns locally worked.

$ chmod +r tnsnames.ora

Examples related to oracle

concat yesterdays date with a specific time ORA-28001: The password has expired how to modify the size of a column How to create a blank/empty column with SELECT query in oracle? Find the number of employees in each department - SQL Oracle Query to display all tablespaces in a database and datafiles When or Why to use a "SET DEFINE OFF" in Oracle Database How to insert date values into table error: ORA-65096: invalid common user or role name in oracle In Oracle SQL: How do you insert the current date + time into a table?

Examples related to odbc

How to connect PHP with Microsoft Access database [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified Does MS Access support "CASE WHEN" clause if connect with ODBC? The specified DSN contains an architecture mismatch between the Driver and Application. JAVA Setting up PostgreSQL ODBC on Windows How to search for rows containing a substring? Simplest Way to Test ODBC on WIndows How to convert "0" and "1" to false and true Excel: Use a cell value as a parameter for a SQL query How do I use a 32-bit ODBC driver on 64-bit Server 2008 when the installer doesn't create a standard DSN?

Examples related to tns

Oracle listener not running and won't start Oracle TNS names not showing when adding new connection to SQL Developer Oracle ORA-12154: TNS: Could not resolve service name Error? Oracle - What TNS Names file am I using?