MySQL on Linux (1)
(COURSERA: Using Databases with Python)
0. INTRO
C(I) R(S) U D
SCHEMA(META-DATA)
1. Instalation
dnf update |
2. Start MySQL service
sudo systemctl start mysqld |
secure the database
mysql_secure_installation |
follow the setup process.
3. Using MySQL
Start up MySQL interface:
mysql -u USERNAME -p |
Some Basic Operations and Single Table CRUD:
mysql> SHOW DATABASES; |
Create table with colums and data info.
mysql> CREATE TABLE YYY( |
Insert data into a table:
INSERT INTO YYY (name, email) VALUES ('MyNAME', 'My@EMAIL.COM') |
Delete data from a table:
DELETE FROM YYY WHERE email='My@EMAIL.COM' |
Update data in a table:
UPDATE YYY SET name='MyNAME' WHERE email='My@EMAIL.COM' |
Select(Read):
SELECT * FROM YYY |
Delete Table:
DROP TABLE YYY |
Delet database:
DROP DATABASE XXX |