bitcoin core – Bitcoind daemon: connection error to the server?

I'm trying to create a new Bitcoin address and store it in a $ NEW_ADDRESS shell variable.

When I execute this command:

$ NEW_ADDRESS = $ (./ bitcoin-cli getnewwaddress)

I receive the following errors:

error: can not connect to server
Make sure that the bitcoind server is running and that you are connecting to the correct RPC port.
-bash: =: command not found

I've tried everything to correct the connection error, including typing the command:

./bitcoind -rpcport = 8332

Or even, by changing the bitcoin configuration:

nano ~ / .bitcoin / bitcoin.conf

And by typing these lines on the configuration:

rpcconnect =
rpcport = 8332;

But nothing works. Does anyone have any idea on how to solve and solve this problem?

Thank you in advance.