{"id":18600625,"url":"https://github.com/rostenkowski/cheats","last_synced_at":"2025-05-16T17:12:06.300Z","repository":{"id":3372632,"uuid":"4419790","full_name":"rostenkowski/cheats","owner":"rostenkowski","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":2,"default_branch":"master","last_synced_at":"2025-02-18T01:25:59.029Z","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/rostenkowski.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/rostenkowski/cheats","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rostenkowski%2Fcheats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rostenkowski%2Fcheats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rostenkowski%2Fcheats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rostenkowski%2Fcheats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rostenkowski","download_url":"https://codeload.github.com/rostenkowski/cheats/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254573589,"owners_count":22093731,"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":"2024-11-07T02:04:45.608Z","updated_at":"2025-05-16T17:12:06.275Z","avatar_url":"https://github.com/rostenkowski.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%2Frostenkowski%2Fcheats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frostenkowski%2Fcheats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frostenkowski%2Fcheats/lists"}