The error you are getting because you have not specified a port and address for geth process to connect. So what it is doing is, when you are using geth attach, get is not able to find the address and port mentioned in the command. You can solve this error, as you have mentioned the address and port while starting the Blockchain.
Follow the below-mentioned step:
geth --datadir ./myDataDir --networkid 1114 console 2 --rpc --rpcport 8543 --rpcaddr 127.0.0.1
There is a lot more to learn than this. Enroll now in Blockchain Online Course to learn more.