Menu
e-lo
  • Home
    • Tech
    • Inspiration and about
  • Database
    • T-SQL
    • SQL Server quick
    • SQL server docs
    • MySql quick sheet
    • Postgre
    • InfluxDB
  • Programming
    • Automating the boring stuff
    • Python 101
    • Python Docs
    • Python Logging
    • cSharp Overview
    • Powershell Latest
    • Powershell 4 lang ref
  • Linux
    • Top CMD’s
    • Useful CMD Linux
    • ss64 Linux
    • Ubuntu
    • 30 things Ubuntu 18.04
  • Azure
    • AZ-104-MS Azure Administrator 101 quick ref
    • ARM Docs
    • ARM Tutorial
    • Azure PS ref
    • Azure CLI ref
    • Deployment scripts (intern/extern)
    • ARM Quickstart
    • ARM templates 4h
  • AzAdm
    • AD 101
    • Governance and Compliance 102
    • Administration 103
    • Virtual Networking 104
    • Storage 107 (With table (NoSQL and more))
    • Virtual Machines 108
    • Azure Virtual Machines 101
    • Monitor VM (and market)
  • Zen
    • Not thinking about anything is Zen
e-lo

MariaDb linux Python ORM

Posted on October 24, 2019October 25, 2019 by espenk

https://linuxize.com/post/how-to-install-mariadb-on-ubuntu-18-04/

MariaDB is an open source, multi-threaded relational database management system, backward compatible replacement for MySQL. It is maintained and developed by the MariaDB Foundation including some of the original developers of the MySQL.

https://linuxize.com/post/how-to-create-a-sudo-user-on-ubuntu/

sudo apt update

sudo apt install mariadb-server

sudo mysql -V

sudo systemctl status mariadb

Run the mysql_secure_installation command to improve the security of the MariaDB installation:

sudo mysql_secure_installation

The script will prompt you to set up the root user password, remove the anonymous user, restrict root user access to the local machine and remove the test database. At the end the script will reload the privilege tables ensuring that all changes take effect immediately.

All steps are explained in detail and it is recommended to answer “Y” (yes) to all questions, except no if you have a sudo password.


Connect to MariaDB from the command line

sudo mysql (cmd access) or mysql -u root -p

DB:

show databases;

To create a MySQL database which uses the utf8 character set:

create database tech character set UTF8 collate utf8_bin

MySQL supports two kinds of UTF8 character sets: utf8 and utf8mb4.

MySQL’s utf8 character table contains characters from the Basic Multililingial Plane, also known as BMP — it is a subset of UTF8 characters which lengths are from 1 to 3 bytes. 4-bytes characters are not included into this character table, and when one attempted to store such characters into a MySQL table, the Incorrect String Value error occurs.

Create a user:

create user ‘espen’ identified by ‘your-password’;

GRANT ALL privileges ON ‘tech‘.* TO ‘espen’@localhost;

flush privileges;

Use tech;

create table test (id int, name varchar(20));

Navigate to env (activate it) run:

pip3 install mysql-connector

ORM:

https://www.sqlalchemy.org/library.html#tutorials

RSS Azure

  • Azure and HITRUST publish shared responsibility matrix January 14, 2021

RSS Python

  • PEP 649: Deferred Evaluation Of Annotations Using Descriptors January 11, 2021

Cloud

ARM (7) azure (22) cmd (1) Django (4) Docker (1) e-lo (2) Flask (2) Github (9) Grafana (2) Information (1) Information Retrieval (11) JAVA (1) kivy (2) Kotlin (4) linux (11) mobile (2) Natural Language Prossesing (NLP) (2) Net.Core (1) Networking and Security (2) OPC (2) PEP8 (1) Philosophy (3) Python (41) Python Networking and Security (2) Reason (2) RMQ (2) Solr (11) Sql (10) VSC (1) Warframe (2) WMVARE (4) Zabbix (7)

Recent Posts

  • 2 TODO MS ARM Template 4h
  • TODO Cryptography with Python – Caesar Cipher
  • 3 TODO Udemy AZ-104 Microsoft Azure Administrator Exam Certification (Scott Duffy)
  • 1 TODO ARM Lab 104 MS (Deployment and more)
  • TODO Prerequisites for Azure administrators 101

Archives

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2021 e-lo | Powered by WordPress & Superb Themes