No risks that I'm aware of, but there is network lag for establishing connections. It will likely work fine now when you are just connecting to localhost
, but your application will probably have scaling issues if you're establishing multiple connections for each HTTP request and you ever want to move to a secondary database server for whatever reason.
A PHP page is inherently single-threaded, so unless you are starting up multiple threads yourself then there's no (extra) concurrency issues. It's still a good idea to use InnoDB and SQL transactions to help prevent concurrency issues across multiple requests.