Almost 23 million New Yorkers' private records have been exposed in data security breaches by more than 3,000 businesses, nonprofits and governments over the past eight years, the New York attorney general reported.

Hacking was responsible for about 40 percent of the 5,000 incidents that led to data security breaches. The other data security breaches were blamed on lost or stolen equipment, insider wrongdoing and inadvertent errors, according to the report released Tuesday.

"As we increasingly share our personal information with stores, restaurants, health care providers and other organizations, we should be able to enjoy the benefits of new technology without putting ourselves at risk," Attorney General Eric Schneiderman said.

Schneiderman urged that companies and security experts cooperate together so that businesses have the tools they need to address these problems when these security breaches occur.

New York state law has required since 2005 that companies report to the attorney general and to the individuals affected when personal information such as social security numbers or drivers license numbers are accessed by an unauthorized person.

Last year there were 7.3 million records compromised by 900 security breaches in New York. That led to a cost of $1.37 billion for the affected companies to investigate, solve and help customers involved in the breaches.

The two largest breaches involved companies. They were the Target security breach that led to 70 million customers' data being stolen (1.8 million New Yorkers) and the LivingSocial security breach that led to 4.75 million New Yorkers' data being stolen.

Target said it has improved security and monitoring as well as improving firewalls and resetting passwords since the breach.

LivingSocial insists no credit card information was taken in the security breach of 2013. However, user names and passwords were stolen.

The report advises businesses to secure data, collect no unnecessary information, create a security plan, set expiration dates on information collected and other important tips. The report also tells consumers to create strong passwords and don't save them on their computers, monitor credit reports and bank records and to not post sensitive data on social media sites.