https://github.com/fadilxcoder/mariadb-mysql
MariaDB / MySQL
https://github.com/fadilxcoder/mariadb-mysql
database php sql
Last synced: 12 days ago
JSON representation
MariaDB / MySQL
- Host: GitHub
- URL: https://github.com/fadilxcoder/mariadb-mysql
- Owner: fadilxcoder
- Created: 2021-02-13T11:18:26.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-14T17:48:20.000Z (almost 5 years ago)
- Last Synced: 2025-10-30T15:48:27.838Z (6 months ago)
- Topics: database, php, sql
- Language: PHP
- Homepage:
- Size: 344 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MariaDB
- `index.php` - connect with mariadb
- Use `adminer.php` to connect to GUI
- - HOST *localhost:3307*
- - DB *maria_db_demo*
### Reference
- https://mariadb.com/kb/en/installing-mariadb-msi-packages-on-windows/ (Depend on OS)
- `my-mariadb-db.sql`
---
# MySQL
## Index / Explain statement
- Index works best on those columns that are the subject of the **WHERE** clauses
- TEXT / BLOB - Does not normally have lenght value, therefore cannot be indexed as it cannot guarantee uniqueness. use VARCHAR
- `experimental_scripts.sql` - located *http://iox.000webhostapp.com/sql/experimental_scripts.sql*
-
SELECT * FROM `addresses` AS A INNER JOIN `cards` AS C INNER JOIN `users` AS U WHERE A.uid = U.id AND C.uid = U.id AND U.fname = 'Stacey' AND U.lname = 'Predovic'
- **No indexing** - Showing rows 0 - 24 (35 total, Query took **85.7867** seconds.)
- **Indexing** - Showing rows 0 - 24 (35 total, Query took **0.9479** seconds.)
- Adding Index to tables
- - > CREATE INDEX idx_fname ON users (`fname`);
- - > CREATE INDEX idx_lname ON users (`lname`);
- - > CREATE INDEX idx_uid ON addresses (`uid`);
- - > CREATE INDEX idx_uid ON cards (`uid`);
- Difference with **EXPLAIN** Statement
- - Before Indexing
- -
- - After Indexing
- -
---
# Notes (Git LFS - large file storage)
- Run `git lfs install`
- create `.gitattributes`
- Run `git lfs track '*.sql'` - Tracking all *.sql* files
- Run `git add .gitattributes`