mysql.service – Start request repeated too quickly

  Error: root@Skeeve:/var/log# systemctl start mysql.service Job for mysql.service failed because the control process exited with error code. See “systemctl status mysql.service” and “journalctl -xe” for details. root@Skeeve:/var/log# systemctl status mysql.service ● mysql.service – MySQL Community Server      Loaded: loaded (/lib/systemd/system/mysql.service; disabled; vendor preset: enabled)      Active: failed (Result: exit-code) since Sun 2021-05-30…

mysql – Disable ONLY_FULL_GROUP_BY

  /etc/mysql/mysql.conf.d/ vi mysqld.cnf [mysqld] sql_mode = “ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION” /etc/init.d/mysql restart

mysqli – Načtení dat

   $spojeni = mysqli_connect(“server”, “uzivatel”, “heslo”, “databaze”); $sql = “SELECT * FROM tabulka”; $data = mysqli_query($spojeni, $sql); if (! $data) {    exit (“<p>Sql: <PRE>” . $sql . “</PRE> Chyba: ” . mysqli_errno($spojeni) . ” – ” . mysqli_error($spojeni) . “</p>”); }$zaznam_pocet = mysqli_num_rows($data);for ($i = 0; $i < $zaznam_pocet; $i++) {    mysqli_data_seek ($data, $i);   …

mysqll – Show privileges

  mysql> show privileges;| Privilege | Context | Comment || Alter | Tables | To alter the table || Alter routine | Functions,Procedures | To alter or drop stored functions/procedures || Create | Databases,Tables,Indexes | To create new databases and tables || Create routine | Databases | To use CREATE FUNCTION/PROCEDURE || Create temporary tables…

mysql – Procedura – ukázka

  CREATE DEFINER=`autor`@`localhost` PROCEDURE `proc_wpfb_kategorie`(IN `in_cat_id` INT, OUT `kategorie` VARCHAR(255)) begin   declare loc_cat_id INT DEFAULT 0;       declare loc_cat_parent INT DEFAULT 999999;       declare kategorie_temp varchar (255) default ”;   set loc_cat_id = in_cat_id;   select cat_name       from wp_wpfb_cats       where cat_id = loc_cat_id      into kategorie;   delej:…

php – mysql – LEFT JOIN

  +——————+         +—————-+ |     TABULKA_1    |         |    TABULKA_2   | +——————+ ——> +—————-+ | VŠECHNY ZÁZNAMY  |         | POUZE ZÁZNAMY, | +——————+         | SE SHODNÝMI    |                          …

php – mysql – REPLACE()

  UPDATE    tabulka SET    sloupec = REPLACE (sloupec, ‘původní_hodnota‘, ‘nová_hodnota‘)