Raspberry Pi als Webserver - MySQL Installation

Heute ist Stammtischzeit:
Jeden Donnerstag 20:30 Uhr hier im Chat.
Wer Lust hat, kann sich gerne beteiligen. ;)
    • Offizieller Beitrag

    Im folgendem Tutorial zeige ich euch wie ihr den MySQL Server auf eurem Raspberry Pi installiert.


    Raspberry Pi als Webserver Tutorials:
    1. SSH Zugang auf dem Raspberry Pi einrichten
    2. Raspberry Pi als Webserver - Apache 2 Installation
    3. Raspberry Pi als Webserver - PHP 5 Installation
    4. Raspberry Pi als Webserver - MySQL Installation
    5. Raspberry Pi als Webserver - phpMyAdmin Installation
    6. Raspberry Pi als Webserver - FTP-Server Installation


    1. Root Rechte holen

    Code
    sudo bash

    2. MySQL installieren

    Code
    apt-get install mysql-server mysql-client php5-mysql


    3. Passwort festlegen
    Als nächstes müsst ihr das root Passwort festlegen

    und wiederholen

    4. Neustart
    Wenn die Installation abgeschlossen ist führen wir einen Neustart aus.

    Code
    sudo restart

    Nun ist der MySQL Server installiert und läuft auf eurem Raspberry Pi!

    Wenn du Fragen und/oder Verbesserungsvorschläge hast, zögere nicht diese unter diesem Beitrag zu stellen.
    Über ein kurzes Feedback, ob es geklappt hat würde ich mich auch sehr freuen!

    Well in my humble opinion, of course without offending anyone who thinks differently from my point of view, but also by looking into this matter in a different way and without fighting and by trying to make it clear and by considering each and every one's opinion, I honestly believe that I completely forgot what I was going to say.

    Einmal editiert, zuletzt von ps915 (15. März 2013 um 19:16)

  • Danke für das gute Tutorial.
    Ergänzend für alle User die eine statische IP benutzen (wenn der MySQL-Server nicht startet).


    [font="Calibri"]nano /etc/mysql/my.cnf [/font]

    [font="Calibri"]bind-address = 127.0.0.0[/font]


    [font="Calibri"]überschreiben mit[/font]


    [font="Calibri"]bind-address = 192.168.2.128 //muss natürlich je nach IP verändert werden[/font]


    [font="Calibri"]Gruß
    [/font]

    Einmal editiert, zuletzt von Dawa (13. April 2013 um 16:32)

  • Hallo !wollte mysql Instalieren hab dann glaub das falsche Passwort eingegeben, mit neu Installation kein erfolg , mysqladmin -u root -p password "WUNSCHPASSWORT" das Passwort geändert , dann versucht neu de/Installieren auch das selbe! gibt es hierfür ne Lösung ? oder Tipps ?
    $ sudo apt-get autoremove
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
    2 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
    [ ok ] Stopping MySQL database server: mysqld.
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing mysql-server-5.5 (--configure):
    subprocess installed post-installation script returned error exit status 1
    dpkg: dependency problems prevent configuration of mysql-server:
    mysql-server depends on mysql-server-5.5; however:
    Package mysql-server-5.5 is not configured yet.

    dpkg: error processing mysql-server (--configure):
    dependency problems - leaving unconfigured
    Errors were encountered while processing:
    mysql-server-5.5
    mysql-server
    E: Sub-process /usr/bin/dpkg returned an error code (1)

  • Hallo myemo5,

    schau dir mal in der Manpage an was "autoremove" überhaupt macht. Du bist in den letzten Tagen bereits der zweite der versucht mit "autoremove" ein Paket zu entfernen.
    Zum Deinstallieren eines Pakets und Löschen aller Konfigurationsdateien wird "purge" verwendet.

    Du verwendest aber nicht rein zufällig Raspbmc als Betriebssystem?

    Gruß Georg

  • Bin vollkommen neu in der Linux Welt , aber gierig danach ........ also azubi ;)
    ich verwende Raspbian ! da würde es dann mit autoremove und deinstall gehn ?
    wenn ich mit sudo apt-get purge mysql-server eingebe bekomme ich folgende Meldung
    pi@raspberrypi ~ $ sudo apt-get purge mysql-server
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package 'mysql-server' is not installed, so not removed
    0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
    1 not fully installed or removed.
    After this operation, 0 B of additional disk space will be used.
    Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
    [ ok ] Stopping MySQL database server: mysqld.
    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing mysql-server-5.5 (--configure):
    subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
    mysql-server-5.5
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    pi@raspberrypi ~ $ sudo purge install mysql-server mysql-client php5-mysql
    sudo: purge: command not found
    pi@raspberrypi ~ $ sudo purge mysql-server mysql-client php5-mysql
    sudo: purge: command not found
    pi@raspberrypi ~ $ sudo apt-get purge mysql-server mysql-client php5-mysql
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package 'mysql-server' is not installed, so not removed
    The following package was automatically installed and is no longer required:
    libmysqlclient18
    Use 'apt-get autoremove' to remove it.
    The following packages will be REMOVED:
    mysql-client* php5-mysql*
    0 upgraded, 0 newly installed, 2 to remove and 1 not upgraded.
    1 not fully installed or removed.
    After this operation, 350 kB disk space will be freed.
    Do you want to continue [Y/n]? Y
    (Reading database ... 64409 files and directories currently installed.)
    Removing mysql-client ...
    Removing php5-mysql ...
    Purging configuration files for php5-mysql ...
    Processing triggers for libapache2-mod-php5 ...
    [....] Reloading web server config: apache2apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName
    . ok
    Setting up mysql-server-5.5 (5.5.31+dfsg-0+wheezy1) ...
    [ ok ] Stopping MySQL database server: mysqld.
    130517 20:59:14 [Note] Plugin 'FEDERATED' is disabled.
    130517 20:59:14 InnoDB: The InnoDB memory heap is disabled
    130517 20:59:14 InnoDB: Mutexes and rw_locks use GCC atomic builtins
    130517 20:59:14 InnoDB: Compressed tables use zlib 1.2.7
    130517 20:59:14 InnoDB: Using Linux native AIO
    130517 20:59:14 InnoDB: Initializing buffer pool, size = 128.0M
    130517 20:59:14 InnoDB: Completed initialization of buffer pool
    InnoDB: Error: auto-extending data file ./ibdata1 is of a different size
    InnoDB: 0 pages (rounded down to MB) than specified in the .cnf file:
    InnoDB: initial 640 pages, max 0 (relevant if non-zero) pages!
    130517 20:59:14 InnoDB: Could not open or create data files.
    130517 20:59:14 InnoDB: If you tried to add new data files, and it failed here,
    130517 20:59:14 InnoDB: you should now edit innodb_data_file_path in my.cnf back
    130517 20:59:14 InnoDB: to what it was, and remove the new ibdata files InnoDB created
    130517 20:59:14 InnoDB: in this failed attempt. InnoDB only wrote those files full of
    130517 20:59:14 InnoDB: zeros, but did not yet use them in any way. But be careful: do not
    130517 20:59:14 InnoDB: remove old data files which contain your precious data!
    130517 20:59:14 [ERROR] Plugin 'InnoDB' init function returned error.
    130517 20:59:14 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
    130517 20:59:14 [ERROR] Unknown/unsupported storage engine: InnoDB
    130517 20:59:14 [ERROR] Aborting

    130517 20:59:14 [Note] /usr/sbin/mysqld: Shutdown complete

    [FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!
    invoke-rc.d: initscript mysql, action "start" failed.
    dpkg: error processing mysql-server-5.5 (--configure):
    subprocess installed post-installation script returned error exit status 1
    Errors were encountered while processing:
    mysql-server-5.5
    E: Sub-process /usr/bin/dpkg returned an error code (1)
    Danke im Voraus für weitere Tipps und aufkärungen !

  • Hallo myemo5,

    Zitat

    Danke im Voraus für weitere Tipps und aufkärungen !

    Es gibt hier im Forum auch sogenannte BB-Codes mit welchen man zum Beispiel Befehle und deren Ausgaben in Code-Fenster darstellen kann. Das erleichtert das Lesen von Posts ungemein. Deine Post kann man kaum lesen weil du noch nichtmal Leerzeilen zwischen Linux-Ausgaben und deinen Fragen verwendest. Bitte gewöhne dir hier die Verwendung von BB-Codes an.

    Mir sind in deinem ersten Post bereits die folgenden Fehlermeldungen aufgefallen.

    Daher auch meine Frage ob du Raspbmc verwendest. Das sieht danach aus, als hättest du Probleme mit der Paketverwaltung. Hast du mal einen (De-)Installations-Vorgang einfach abgebrochen oder dem Raspberry Pi die Stromversorgung abgezogen? An deiner Stelle würde ich Raspbian nochmal neu installieren. Ansonsten musst du irgendwie versuchen deine Paketverwaltung wieder auf die Reihe zu bekommen.

    Gruß Georg

  • Hallo,

    wie kann ich die geänderte bind-adress denn ändern? Mit welchem Befehl (und wo soll der hin) kann ich speichern? Wenn ich über F2 und "Y" gehe, kommt die Fehlermeldung "Permission denied".

    Kann mir da jemand helfen?

    Ich nutze übrigens Putty

  • Dir fehlt ein "sudo" vor dem nano... Du hast nicht genug Berechtigungenmit dienem Benutzer um in Systemdateien rumzuschreiben, mit sudo sagst du "mach das als root" und root ist bei Linux das was bei Windows der admin ist.

  • Hallo,
    ich versuche auch MySQL auf dem rpi zu installieren, allerdings, geht nichts. Ich warte nun schon seit fünf stunden, und er sagt immernoch "setting up ...und so weiter der cursor blink, ausserdem wurde alles in einer screen sitzung gestartet. Eine abfrage in einem anderem terminal zeigt, das der pi gerade einmal zu 45% cpu teschnisch ausgelastet ist. RAM mäßig sieht es ähnlich aus. Was ist da los? langsam frustriet es einfach nur noch. Es ist ja nicht das erste mal, dass ich versuche mysql an diesem tag zu installieren.
    Ich habe es auch kommplett deinstalliert, mit rm -rf /var/lib/mysql und wieder installiert. Jetzt läuft er schon wieder seit rund 30min, ohne das sich was tut. Ich habe das datenbank pw festlegen können, danch sieht es so aus:

    weiter kommt er nie
    ------------------
    ich wollte an dieser stelle nur noch darauf hinweisen, das ich davor PHPmyadmin installieren wollte, aber mysql nicht instaliert war. so musste ich die installation von pma abbrechen.naturlich habe ich danach pma wieder deinstalliert.
    :@
    Bitte helft mit :(

    Some people have told me they don't think a fat penguin really embodies the grace of Linux, which just tells me they have never seen a angry penguin charging at them in excess of 100mph. They'd be a lot more careful about what they say if they had."[1996] -Linus Torvalds (*1969) :geek: ~hehxes

  • wie kann man denn diese Datei editieren ?
    mit SCP habe ich keine Rechte ..
    ist es die IP-Adresse des Raspberrys?

    Herzliche Grüße und vielen Dank

    Thomas

    seit 2012 RASPI-Laiennutzer

    1x PI1

    2x PI2B

    1 x PI3B (am 2022-04-08) abgeraucht

    PI4B in Beschaffung

  • Wenn man eine frische Raspbian Installation hat, reicht dann dieses MySQL tutorial ?
    Habe es so gemacht und konnte von einen anderen PC aus nicht darauf zugreifen.

    Möchte nur ein Headless OS haben wo MySQL läuft für die Kodi Datenbank.
    (auch wenn es damit nichts zu tun hat, weiß jemand wie es dann mit der Datenbank funktioniert?
    Brauch man nur neue Inhalte in die Ordner packen und er erkennt es Automatisch und erweitert automatisch die MySQL Datenbank?)

Jetzt mitmachen!

Du hast noch kein Benutzerkonto auf unserer Seite? Registriere dich kostenlos und nimm an unserer Community teil!