Instalacja mysql

root@asl-client2:~# apt-get install mysql-server
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
  libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient16
  libnet-daemon-perl libplrpc-perl mysql-client-5.1 mysql-common
  mysql-server-5.1 mysql-server-core-5.1
Suggested packages:
  libipc-sharedcache-perl libterm-readkey-perl tinyca
The following NEW packages will be installed:
  libdbd-mysql-perl libdbi-perl libhtml-template-perl libmysqlclient16
  libnet-daemon-perl libplrpc-perl mysql-client-5.1 mysql-common mysql-server
  mysql-server-5.1 mysql-server-core-5.1
0 upgraded, 11 newly installed, 0 to remove and 69 not upgraded.
Need to get 24.1 MB of archives.
After this operation, 61.1 MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Get:1 http://ftp.pl.debian.org/debian/ squeeze/main mysql-common all 5.1.49-3 [70.9 kB]
Get:2 http://ftp.pl.debian.org/debian/ squeeze/main libnet-daemon-perl all 0.43-1 [46.6 kB]
Get:3 http://ftp.pl.debian.org/debian/ squeeze/main libplrpc-perl all 0.2020-2 [36.0 kB]
Get:4 http://ftp.pl.debian.org/debian/ squeeze/main libdbi-perl amd64 1.612-1 [883 kB]
Get:5 http://ftp.pl.debian.org/debian/ squeeze/main libmysqlclient16 amd64 5.1.49-3 [1,985 kB]
Get:6 http://ftp.pl.debian.org/debian/ squeeze/main libdbd-mysql-perl amd64 4.016-1 [140 kB]
Get:7 http://ftp.pl.debian.org/debian/ squeeze/main mysql-client-5.1 amd64 5.1.49-3 [10.1 MB]

(.....)

Setting up libnet-daemon-perl (0.43-1) ...
Setting up libplrpc-perl (0.2020-2) ...
Setting up libdbi-perl (1.612-1) ...
Setting up libmysqlclient16 (5.1.49-3) ...
Setting up libdbd-mysql-perl (4.016-1) ...
Setting up mysql-client-5.1 (5.1.49-3) ...
Setting up mysql-server-core-5.1 (5.1.49-3) ...
Setting up mysql-server-5.1 (5.1.49-3) ...
Stopping MySQL database server: mysqld.
120227 17:55:13 [Note] Plugin 'FEDERATED' is disabled.
120227 17:55:13  InnoDB: Started; log sequence number 0 44233
120227 17:55:13  InnoDB: Starting shutdown...
120227 17:55:18  InnoDB: Shutdown completed; log sequence number 0 44233

Starting MySQL database server: mysqld.
Checking for corrupt, not cleanly closed and upgrade needing tables..
Setting up libhtml-template-perl (2.9-2) ...
Setting up mysql-server (5.1.49-3) ...
root@asl-client2:~#
W trakcie instalacji podalismy haslo uzytkownika root. Wykorzystamy teraz to haslo do zalogowania sie do bazy:
root@asl-client2:~# mysql -u root -p mysql
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 40
Server version: 5.1.49-3 (Debian)

Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
This software comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to modify and redistribute it under the GPL v2 license

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>
W pliku /etc/mysql/my.cnf ustawiamy, zeby serwer mysql nasluchiwal na wszystkich adresach (w tym na adresie 192.168.1.131) przez ustawienie parametru 0.0.0.0:
bind-address            = 0.0.0.0
apt-get install phpmyadmin
Zrestartowanie usług:
/etc/init.d/apache2 restart
/etc/init.d/mysql restart
Utworzenie konta kalkos, bazy danych baza1 oraz przydzielenie odpowiednich uprawnień.
root@asl-client2:~# mysql -u root -p mysql
Enter password:
(...)
mysql> CREATE USER 'kalkos'@'%' IDENTIFIED BY 'mojehaslo';
mysql> CREATE DATABASE baza1;
mysql> GRANT ALL ON baza1.* TO 'kalkos'@'%';
W pliku konfiguracyjnym /etc/mysql/my.cnf serwera dodaj w sekcji [mysqld]:
log-bin                 = mysql-bin
server-id               = 1