{"id":28927501,"url":"https://github.com/stepansvoboda/cheats","last_synced_at":"2026-04-22T21:38:50.378Z","repository":{"id":3372632,"uuid":"4419790","full_name":"stepansvoboda/cheats","owner":"stepansvoboda","description":"PostgreSQL / MySQL / Cheatsheet","archived":false,"fork":false,"pushed_at":"2017-10-04T19:15:45.000Z","size":11,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-12T17:02:51.802Z","etag":null,"topics":["cheatsheet","database-management","export","import","mysql","postgresql"],"latest_commit_sha":null,"homepage":"","language":null,"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/stepansvoboda.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}},"created_at":"2012-05-23T12:35:43.000Z","updated_at":"2017-10-04T19:18:50.000Z","dependencies_parsed_at":"2022-09-07T07:30:41.171Z","dependency_job_id":null,"html_url":"https://github.com/stepansvoboda/cheats","commit_stats":null,"previous_names":["stepansvoboda/cheats"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stepansvoboda/cheats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepansvoboda%2Fcheats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepansvoboda%2Fcheats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepansvoboda%2Fcheats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepansvoboda%2Fcheats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stepansvoboda","download_url":"https://codeload.github.com/stepansvoboda/cheats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stepansvoboda%2Fcheats/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261297020,"owners_count":23137228,"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":["cheatsheet","database-management","export","import","mysql","postgresql"],"created_at":"2025-06-22T13:12:22.594Z","updated_at":"2026-04-22T21:38:50.370Z","avatar_url":"https://github.com/stepansvoboda.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# PostgreSQL\n\n\n```bash\nsudo su postgres\npsql\n```\n```sql\nCREATE USER user WITH PASSWORD 'password' LOGIN;\nCREATE DATABASE project;\nGRANT ALL ON DATABASE project TO user;\n```\n## Export\n```bash\npg_dump database \u003e database.sql\n```\n## Import\n```bash\npsql -d database \u003c file.sql \n```\n\n# MySQL\n```bash\nmysql -u root -p\n```\n```sql\nCREATE USER 'user'@'localhost' IDENTIFIED BY 'password';\nCREATE DATABASE project;\nGRANT ALL PRIVILEGES ON project.* TO 'user'@'localhost';\nFLUSH PRIVILEGES;\n```\n## Export\n```bash\nmysqldump -uroot -p database \u003e\u003e database.sql\n```\n## Import\n```bash\nmysql -uroot -p -Ddatabase \u003c database.sql\n```\n## Reset root password\n```bash\nsudo dpkg-reconfigure mysql-server\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepansvoboda%2Fcheats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstepansvoboda%2Fcheats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstepansvoboda%2Fcheats/lists"}