FR:RPi MySQL

From eLinux.org
Revision as of 12:05, 26 May 2013 by Xavier (Talk | contribs) (Installation de MySQL sur Raspberry Pi)

Jump to: navigation, search

Installation de MySQL sur Raspberry Pi

Ceci est un guide pour installer MySQL Community Edition (aka "MySQL") sur l'ordinateur Raspberry Pi sous Debian "squeeze".

MySQL est constitué de deux composants distincts :

  • MySQL Server
    • Le programme qui enregistre et traite réellement les données.
      Il n'y a en général aucun moyen d'interagir avec les données stockées dans le serveur sans utiliser un client externe ou une bibliothèque.
  • MySQL Client
    • Un programme ou une bibliothèque qui se connecte à un serveur de base de données MySQL existant.
      Cela est considéré comme un "front end" vers la base de données - un moyen pour l'utilisateur d'envoyer ou de recevoir des données du serveur de base de données.

Le guide a été développé/testé avec debian6-19-04-2012. Selon que vous ayez ou non choisi d'installer Ruby, il peut ne pas y avoir assez de place sur une image standard de 2Go. C'est particulièrement vrai si vous avez déjà installé autre chose. Voyez comment étendre votre image ici oo .

Installation de MySQL Server à partir du dépôt Debian

Commandes

# Install MySQL Server from the Debian repository
sudo apt-get install mysql-server

The package manager may suggest a slew of dependencies for MySQL Server. Press "Y" then "enter" (or just "enter") to continue installation. The MySQL installation process will prompt for a password for the MySQL root user account. You can enter a password, or press "enter" to skip the password step - it is your choice. It is poor security to have a blank password if you will be running the MySQL Server on a shared network, but shouldn't matter if you are only using the system for development. The installation process will prompt you two additional times for a MySQL root password. Continue entering the same password (or skipping it) as you did at the first prompt. The MySQL Client is installed as part of the standard MySQL Server package from the Debian repository. You do not need to install additional software to start using MySQL.

Test de votre installation

# Verify the MySQL Client was installed
mysql --version
# Connect to the MySQL Server on localhost
mysql --user=root --password=password

Installation de MySQL Client à partir du dépôt Debian

The MySQL Client is a "front end" to an existing database; it does not install the MySQL Server. The MySQL Client can be used to connect to MySQL Server databases across a network. It provides a text-based interface to a MySQL Server, and requires a basic understanding of standard SQL commands. (ie SELECT, UPDATE, INSERT, and DELETE).

Commandes

# Install MySQL Client from the Debian repository
sudo apt-get install mysql-client

The package manager may suggest a slew of dependencies for MySQL Client. Press "Y" then "enter" (or just "enter") to continue installation.

Test de votre installation

The following instructions make these assumptions:

  • You have an existing MySQL Server, whether on localhost or elsewhere across the network
  • The existing MySQL Server "listens for" (accepts) network connections (disabled on a default installation of MySQL Server)
  • The MySQL Server has either:
    • Allowed "root" login over a network connection (disabled on a default installation of MySQL Server), or
    • A MySQL user account for you

Test de votre installation

# Verify the MySQL Client was installed
mysql --version
# Connect to a remote MySQL Server (assumes the server allows root access from a remote computer)
mysql --host=server_address --user=root --password=password
# Connect to a remote MySQL Server (assumes the server has already created your user account)
mysql --host=server_address --user=user_name --password=password