{"id":20003250,"url":"https://github.com/mbrsagor/mysql","last_synced_at":"2025-06-14T17:05:47.189Z","repository":{"id":111135746,"uuid":"250547287","full_name":"mbrsagor/MySql","owner":"mbrsagor","description":"MySql database command line","archived":false,"fork":false,"pushed_at":"2020-08-24T20:08:47.000Z","size":65,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-02T00:26:36.619Z","etag":null,"topics":["data","mysql","mysql-database","sql"],"latest_commit_sha":null,"homepage":"","language":"TSQL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbrsagor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-03-27T13:53:01.000Z","updated_at":"2021-02-05T13:09:21.000Z","dependencies_parsed_at":"2023-06-02T21:15:40.560Z","dependency_job_id":null,"html_url":"https://github.com/mbrsagor/MySql","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mbrsagor/MySql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FMySql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FMySql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FMySql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FMySql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrsagor","download_url":"https://codeload.github.com/mbrsagor/MySql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrsagor%2FMySql/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259851736,"owners_count":22921632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data","mysql","mysql-database","sql"],"created_at":"2024-11-13T05:24:47.697Z","updated_at":"2025-06-14T17:05:47.164Z","avatar_url":"https://github.com/mbrsagor.png","language":"TSQL","funding_links":[],"categories":[],"sub_categories":[],"readme":"## MySql tutorial\n\nThe tutorial is not for advance user. You may run the command your terminal here all of 'Query' for very basic. I will try to share day by day advance topic and complex query. If have any kind of wrong please forgive me because of I am also learning.\n\n### How to create mysql user?\n ```CREATE USER 'Sagor'@'localhost' IDENTIFIED BY '12345';```\n\n ### List of all users\n ``` 'SELECT user, host FROM mysql.user'; ```\n\n ### How to exit from `MySql' ?\n Run ``` exit ``` command\n\n### How to create database?\n\n``` CREATE DATABASE 'db_name'; ```\n\n### List of databases\n``` show databases; ```\n\n### List of table in the dataase\nFirst select database ```use database_name``` Then ```show tables```\n\n### How to create table?\n```\nCREATE TABLE table_name (\n    -\u003e id INT AUTO_INCREMENT,\n    -\u003e first_name varchar(50),\n    -\u003e last_name varchar(50),\n    -\u003e email varchar(70),\n    -\u003e password varchar(50),\n    -\u003e address varchar(50),\n    -\u003e is_admin TINYINT(1),\n    -\u003e register_date DATETIME,\n    -\u003e PRIMARY KEY(id)\n    -\u003e );\n```\n\n### How to `insert` data into table?\n``` \nINSERT INTO table_name(first_name, last_name, email, password, address, is_admin, register_date)\nVALUES('mbr', 'sagor', 'mbrsagor@gmail.com', '12345@123', 'Uttara sector#11 road#10/B', 1, date()); \n```\n\n### Show all data\n``` SELECT FROM * table_name ```\n\n### How to `filter` or query in database?\n```SELECT * FROM WHERE table_name address='uttara';```\n\n### How to `filter` or query `multiple` in database?\n```SELECT * FROM WHERE table_name address='uttara' AND id=1;```\nOR\n``` SELECT * FROM WHRE table_name is_admin \u003e0 ```\n\n### Update table row\n```UDPATE table_name SET email='brshagor.cse@gmail.com' WHERE ID=1;```\n\n### How to `Delete` row from the table?\n```DELETE FROM table_name id=1; ```\n\n### How to show table column/fields ?\n``` SHOW COLUMNS FROM table_name ```\n\n### How to show table?\n``` show Tables ```\n\n### How to `alter` table?\n```ALTER TABLE users ADD age varchar(6)```\n\n### How to modify column?\n```ALTER TABLE users MODIFY COLUMN age INT(6);```\n\n### Order by ASC\n```SELECT * FROM users ORDER BY email ASC;```\n\n### Delete table\n``` drop table table_name```\n\n### How to delete database?\n``` DROP DATABASE 'db_name'; ```\n\n### How to export mysql database?\n``` mysqldump -u root -p db_name | gzip \u003e eco.sql.zip ```\n \n### How to Import mysql database?\n``` mysql -u root -p db_name \u003c ~/Desktop/database/db_name.sql ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrsagor%2Fmysql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrsagor%2Fmysql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrsagor%2Fmysql/lists"}