Tag: MySQL

MySQL is an open-source relational database management system (RDBMS) known for its speed, reliability, and ease of use, commonly used for storing and managing structured data in various applications.

  • mysqldump: how to use a specific port

    mysqldump: how to use a specific port

    Written by

    in

    To use a specific port with the mysqldump command, you can provide the –port (or -P) option followed by the port number you want to use. The –port option specifies the TCP/IP port number to use when connecting to the MySQL server. When using -P remember to use an uppercase P, because the lowercase option…

    Read more

  • mysqldump: how to exclude or include tables

    mysqldump: how to exclude or include tables

    Written by

    in ,

    mysqldump is a command-line tool used for creating database backups in MySQL. By default, mysqldump includes all tables of the specified database when creating the dump. In some cases, it is useful to exclude some of the tables or even include only some of them. For me, this helped to exclude one of the biggest…

    Read more

  • MySQL error: Cannot truncate a table referenced in a foreign key constraint

    MySQL error: Cannot truncate a table referenced in a foreign key constraint

    Written by

    in

    By default, you cannot TRUNCATE (empty) a table that has foreign key constraints applied on it. This is to keep the data consistent over multiple tables that are linked by constraints. Nevertheless, it might be necessary to truncate all data from a table. Here are a few options you can consider to resolve this issue: Solution 1…

    Read more

  • Apache2, PHP und MySQL über MacPorts installieren

    Es gibt hier im Blog bereits eine Vielzahl an Posts zu diesem Thema. Warum? Mit jedem Update von Mac OS X scheint sich wieder etwas zu ändern, sodass die Installation von Apache / PHP / MySQL mittels MacPorts nicht mehr funktionieren möchte. Was bei den einzelnen OS X Versionen zu beachten ist, ist in den…

    Read more

  • MySQL: Tabellen in andere Datenbank kopieren

    Written by

    in

    Mit nachstehenden MySQL-Befehlen lässt sich eine Tabelle recht einfach in eine andere Datenbank kopieren. In diesem Beispiel werden die Daten von db1 in db2 kopiert. Zunächst muss die neue Tabelle (mit gleicher Struktur) erstellt werden: CREATE TABLE db2.newTable LIKE db1.oldTable Danach können die Daten in die neue Tabelle kopiert werden: ALTER TABLE db2.newTable DISABLE KEYS…

    Read more

  • MySQL-Variablen für Spaltennamen (und andere Identifier) verwenden

    Written by

    in

    Variablen lassen sich in MySQL hervorragend für Strings, Zahlenwerte oder auch binäre Daten verwenden. Möchte man diese Variablen jedoch zum Adressieren von Spalten, Tabellen oder Datenbanken verwenden, dann erfordert dies ein etwas anderes Vorgehen. Dieser Artikel gibt eine kurze Zusammenfassung, wie man MySQL-Variablen in Abfragen einsetzt.

    Read more

  • Spalte einer MySQL-Tabelle verschieben

    Written by

    in

    Die Spalte einer MySQL-Tabelle lässt sich folgendermaßen an eine andere Position verschieben: ALTER TABLE <tabelle> MODIFY <spaltenname> tinyint(1) DEFAULT ‘0’ AFTER <spaltenname_vor_neuer_position> Wichtig ist hierbei auch die Angabe der Spaltendefinitionen. Eingaben wie “tinyint(1) DEFAULT ‘0’” müssen also den Definitionen der Spalte entsprechen und beim Verschieben mit angegeben werden.

    Read more

  • MySQL: “ORDER BY” und deutsche Umlaute

    Written by

    in

    Verwendetet man in einer MySQL-Datenbank die falsche Kollation, dann kann eine Sortierung mit ORDER BY in Verbindung mit deutschen Umlauten (ä, ö, ü) zu einer falschen Sortierreihenfolge führen. Die Ausgabe könnte dann folgendermaßen aussehen:

    Read more

  • MySQL Datentypen

    Written by

    in

    MySQL unterstützt verschiedene Datentypen, die sich in drei Gruppen einteilen lassen: Numerisch, Datum/Zeit und String (Zeichen). Die folgende Liste enthält eine Zusammenfassung der dabei möglichen Typen:

    Read more

  • Simple Optimization for PHP and MySQL

    Simple Optimization for PHP and MySQL

    Written by

    in

    Here is a list of a few very simple tips for optimizing your PHP and MySQL applications. Keep these in mind while developing. MySQL PHP Source: http://www.dublish.com/articles/10.html Picture by SpaceX on Unsplash

    Read more