Apr 07

How-to install a MySQL server on Debian Etch

Category: Linux   — Published by tengo on April 7, 2008 at 1:08 pm

As simple as this:

$ apt-get install mysql-common mysql-server mysql-server-5.0

a small wizard should as for a root password (for the mysql server), otherwise:

$ mysqladmin -u root -p password 'NewMysqlRootPassword'

You can create a database like this

$ mysqladmin -p create TestDatabase

and add users like this (allowing access to the just created db):

$ mysql -u root -p
Enter Password: *****
mysql> create user 'NewUser'@localhost identified by 'NewPassword';
mysql> GRANT ALL PRIVILEGES ON TestDatabase . * TO NewUser@'localhost';
mysql> FLUSH PRIVILEGES;
mysql> quit

Voila!

But, important! Keep in mind that the MySQL server is another daemon which might be vulnerable to attackers, so read this about securing the MySQL service.