Graphical Clients
If you'd rather interact with a database by using a graphical database client than with the command-line clients discussed in the previous section, you're in luck: A few options are available.
MySQL has an official graphical client, called MySQLGUI. MySQLGUI is available in both source and binary formats from the MySQL website at http://www.mysql.com/.
Web-based administration interfaces are also available for MySQL and PostgreSQL. phpMyAdmin and phpPgAdmin are two such products. Both of these products are based on the PHP-embedded scripting language and therefore require you to have PHP installed. Of course, you also need to have a web server installed.
The following commands are useful for creating and manipulating databases in Fedora:
> createdb
— Creates a new PostgreSQL database
> createuser
— Creates a new PostgreSQL user account
> dropdb
— Deletes a PostgreSQL database
> dropuser
— Deletes a PostgreSQL user account
> mysql
— Interactively queries the mysqld
server
> mysqladmin
— Administers the mysqld
server
> mysqldump
— Dumps or backs up MySQL data or tables
> pgaccess
— Accesses a PostgreSQL database server
> pg_ctl
— Controls a PostgreSQL server or queries its status
> psql
— Accesses PostgreSQL via an interactive terminal
Reference
> http://www.mysql.com/ — This is the official website of the MySQL database server. Here you can find the latest versions as well as up-to-date information and online documentation for MySQL. You can also purchase support contracts here. You might want to look into this if you will be using MySQL in a corporate setting. (Many corporations balk at the idea of using software for which the company has no support contract in place.)
> http://www.postgresql.org/ — This is the official website of the PostgreSQL database server. You are asked to select a mirror when you arrive at this site. After you select a mirror, you are taken to the main site. From there, you can find information on the latest versions of PostgreSQL and read the online documentation.
> http://www.postgresql.org/docs/8.1/interactive/tutorial-start.html — This interactive HTML documentation tree is a great place to get started with learning how to use PostgreSQL.
> http://www.pgsql.com/ — This is a commercial company that provides fee-based support contracts for the PostgreSQL database.
CHAPTER 19
File and Print
In the early days of computing, file and printer sharing was pretty much impossible because of the lack of good networking standards and interoperability. If you wanted to use a printer connected to another computer, you had to save the file to a floppy disk and walk over.
Nowadays, both file and printer sharing have become second nature in a world where it is not unusual for someone to own more than one computer. Whether it be for sharing photographs among various computers, or having a central repository available for collaboration, file sharing is an important part of our information age. Alongside this is the need to be able to share printers; after all, no one wants to have to plug and unplug a computer to a printer just to print out a quick letter.
Whatever your reasons for needing to share files and printers across a network, you will find out how to do both in this chapter. It looks at how you can share files using the popular UNIX
Using the Network File System
NFS is the protocol developed by Sun Microsystems that allows computers to use a remote file system as if it were a real part of the local machine. A common use of NFS is to allow users' home directories to appear on every local machine they use, thus eliminating the need to have physical home directories. This opens up hot- desking and other flexible working arrangements, especially because no matter where the user is, his home directory follows him around.
Another popular use for NFS is to share binary files between similar computers. If you have a new version of a package that you want all machines to have, you have to do the upgrade only on the NFS server, and all hosts running the same version of Fedora will have the same upgraded package.
NFS Server Configuration
You configure the NFS server by editing the /etc/exports
file. This file is similar to the /etc/fstab
file in that it is used to set the permissions for the file systems being exported. The entries look like this:
/file/system yourhost(
This shows three common clients to which to share /file/system
. The first, yourhost
, shares /file/system
to just one host. The second, .yourdomain.com
, uses the asterisk (*
) as a wildcard to enable all hosts in yourdomain.com
to access /file/system
. The third share enables all hosts of the Class C network, 192.168.0.0
, to access /file/share
. For security, it is best not to use shares like the last two across the Internet because all data will be readable by any network the data passes by. Some common options are shown in Table 19.1.