Setting up a Debian server: A practical example of setting up a Linux server | ||
---|---|---|
<<< Previous | Next >>> |
Some of my users want to use MySQL in their web pages. Who am I to say no to this very reasonable request.
As with the PostgreSQL database, and everything else, we need to install some packages:
apt-get install mysql-server apt-get install mysql-doc apt-get install php4-mysql apt-get install libdbd-mysql-perl apt-get install webmin-mysql |
And we should now have installed the MySQL server, interfaces to Perl and PHP4 and the WebMin module for MySQL.
In it's default install, an anonymous user is able to do some tremendous damage to the database. This is not really a Good Thing (tm), and we want to change this.
To do this, we want to disable almost anything permitted at this time, and to assign new permissions. This is easiest done in WebMin.
Go to Servers->MySQL Database Server->User Permissions Drop all permissions from the user "Anonymous" Set a password for the user "root" |
Webmin will now throw up a DBI error, which is OK, since we just password protected the root user. Log in as root in the database, and that should be it.
When assigning databases to a user, You just need to do the following:
Create a database
Usually this database has the same name as the user that is to use the database.
Create a user permission
The user should have NO permissions at this point.
Create a database permission
Here we assign the user all permissions, except grant, to the database.
If we want to make things easier for local users, we can create the file .my.cnf in the users home directory. This file should contain logon information for the database, and should at the most have the permissions 0600 (-rw-------). The file should look like this:
[client] host = localhost user = <mysql-user> password = <mysql-password> database = <mysql-database> |
<<< Previous | Home | Next >>> |
Database server (PostgreSQL) | Print server (LPD) |