Here is a repository of free textbooks and educational materials:
The question: How does one get access to online database?
Online resources 
- Wikibooks (multilingual) - all resources are freely accessible and copyleft
- Wikisource (multilingual) - all resources are freely accessible and copyleft
- LookSmart Find Articles - hosts HTML versions of countless journals; many of the articles are free to access
- Google Books - full text search for countless books; some have full text available
- Textbook Revolution
- Cornell University Library
- The National Academies Press - PDF books both free and for sale
- Project Gutenberg
- The Open Library - a project of the Internet Archive
Physical libraries 
Public libraries 
The following passage is adapted from http://www.kk.org/cooltools/archives/001285.php.
Several large public libraries in the U.S.A. provide electronic access to vast document collections. Some of these libraries sell memberships for about $100 (annual membership fee) that allow access to commercial document databases. For example, the San Francisco Public Library provides access to about 100 document databases to members. The that to get a library card from the San Francisco Public Library you must prove residence in the state of California. Anyone living in California can get a library card for the San Francisco Public Library (for free) that give access to the JSTOR online journals. To get your card you need to go to the library in person.
Ohio and Michigan have consortiums of public libraries that provide access to many databases.
The New York Public Library allows membership to non-residents of New York and remote (internet) access to about 85 of its 300 document databases. These 85 databases do not include the JSTOR database. Access is provided to collections of e-books, audio books, and videos that are available for legal downloading. For the New York Public Library you can apply online and receive your card by mail.