User Tools

Site Tools


sermn_wiki:userpages:marta:mysql

This is an old revision of the document!


MySQL

Instalar els paquetes necesaris per al servidor mysql.

Desprès, cal canviar-li el password al usuari root de MySQL (no el del sistema), això es fa per tindre més seguretat a les notres bases de dades.

Como a root ejecutar:

mysql -u root mysql\\

per entrar a MySQL com usuari root a la base de dades que anomenada mysql (és la base de dades que ve per defecte).

Un cop a dins de MySQL, escriure:

mysql> UPDATE user SET Password = PASSWORD('contrasenya')WHERE User = 'root';\\

Sustituïnt “contrasenya” per la contrasenya que es vol assignar.

PHPMyAdmin

És una interficie web en PHP per gestionar les bases de dades MySQL.

phpmyadmin

Instalació i configuració

El primer de tot és istalar el contigunt del phpmyadmin al nostres servidor.

Per tindre accés a l'aplicació, es crea un enllaç simbolic a la carpeta del servidor que apunti a la carpeta on es troba el programa.

Ara toca editar el fitxer /etc/phpmyadmin/config.inc.php amb el següent contigut

 <?php
    /* Servers configuration */
    $i = 0;
    
    /* Server localhost (http) [1] */
    $i++;
    $cfg['Servers'][$i]['host'] = 'localhost';
    $cfg['Servers'][$i]['extension'] = 'mysqli';
    $cfg['Servers'][$i]['connect_type'] = 'tcp';
    $cfg['Servers'][$i]['compress'] = false;
    $cfg['Servers'][$i]['controluser'] = 'user';
    $cfg['Servers'][$i]['controlpass'] = 'xxxxxxxx';
    $cfg['Servers'][$i]['auth_type'] = 'cookie';
    $cfg['Servers'][$i]['bookmarktable'] = 'pma_bookmark';
    $cfg['Servers'][$i]['relation'] = 'pma_relation';
    $cfg['Servers'][$i]['table_info'] = 'pma_table_info';
    $cfg['Servers'][$i]['table_coords'] = 'pma_table_coords';
    $cfg['Servers'][$i]['pdf_pages'] = 'pma_pdf_pages';
    $cfg['Servers'][$i]['column_info'] = 'pma_column_info';
    $cfg['Servers'][$i]['history'] = 'pma_history';
    $cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
 ?>

També cal incloure a les directives a la configuració de l'apache (apache.conf i htaccess) :

 Allow from localhost
     htpasswd is used to create and update  the  flat-files  used  to  store
     usernames  and  password  for  basic  authentication  of HTTP users. If
     htpasswd cannot access a file, such as not being able to write  to  the
     output  file  or not being able to read the file in order to update it,
     it returns an error status and makes no changes.
     
     Resources available from the Apache HTTP server can  be  restricted  to
     just  the  users  listed in the files created by htpasswd. This program
     can only manage usernames and passwords stored in a flat-file.  It  can
     encrypt and display password information for use in other types of data
     stores, though. To use a DBM database see dbmmanage.
     
     htpasswd encrypts passwords using either a version of MD5 modified  for
     Apache,  or the system’s crypt() routine. Files managed by htpasswd may
     contain  both  types  of  passwords;  some  user   records   may   have
     MD5-encrypted  passwords  while  others in the same file may have pass‐
     words encrypted with crypt().

Localització dels fitxers de configuració

Els fitxers de configuració es troben enllaçats entre ells de la següent forma:

/usr/share/phpmyadmin/config/config.inc.php/var/lib/phpmyadmin/config.inc.php

/var/www/phpmyadmin/usr/share/phpmyadmin

Per tant
/var/www/phpmyadmin/config/config.inc.php/var/lib/phpmyadmin/config.inc.php

i a la vegada existeix el fitxer /usr/share/phpmyadmin/config.inc.php que inclou els fitxers /usr/share/phpmyadmin/config/config.inc.phpi /etc/phpmyadmin/config.inc.php

Enllaços

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
sermn_wiki/userpages/marta/mysql.1227528064.txt.gz · Last modified: 2008/11/24 13:01 by marta