3.4.1. Servidor MySQL

Objectivo

Instalar o servidor de base de dados MySQL, com uma configuração mínima.

NOTA:
A instalação por omissão do MySQL só aceita ligações a partir do próprio posto (localhost). Isto não é problemático, uma vez que a base de dados só será utilizada por aplicações do próprio posto.

Instalação

server:~# apt-get install mysql-server-5.0 mysql-client-5.0

Configuração

A instalação por omissão do MySQL cria um utilizador root sem password. Por segurança, o primeiro passo é alterar a password de root. Este é o utilizador root do MySQL, não do sistema, pelo que as passwords devem ser diferentes:

server:~# mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.0.32-Debian_7etch1-log Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> USE mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> UPDATE user SET Password=PASSWORD('nova-password') WHERE user='root';
Query OK, 2 rows affected (0.00 sec)
Rows matched: 2  Changed: 2  Warnings: 0

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)

mysql> quit;
Bye

Links relacionados


BlinkListblogmarksco.mmentsconnoteadel.icio.usdiggFarkfeedmelinksFurlLinkaGoGoMa.gnoliaNewsVineNetvouzRedditSimpySpurlWistsYahooMyWebFacebook

Comentários

Add a new comment
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License