{"id":753,"date":"2020-02-22T22:42:41","date_gmt":"2020-02-23T04:42:41","guid":{"rendered":"https:\/\/linux.asberry.org\/blog_tech\/?p=753"},"modified":"2020-02-22T22:42:41","modified_gmt":"2020-02-23T04:42:41","slug":"mysql-new-database-new-user","status":"publish","type":"post","link":"https:\/\/asberry.org\/blog_tech\/?p=753","title":{"rendered":"MySQL &#8211; New Database > New User"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">I&#8217;m trying to get a little more granular on DB security in Linux and to that end used the MariaDB root user for all LAMP installations is probably not the brightest idea. I&#8217;ll try to commit this to memory but until then I&#8217;ll follow these steps to create a new database and then a new user with full access to that DB thereby isolating the databases from each other so one breach doesn&#8217;t take down the system.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: sql; gutter: false; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nmysql -u root -p\n\nCREATE DATABASE newDatabase;\n\nGRANT ALL PRIVILEGES ON newDatabase.* TO &#039;newUser&#039;@&#039;localhost&#039; IDENTIFIED BY &#039;newPassword&#039; WITH GRANT OPTION;\n\nFLUSH PRIVILEGES;\n\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>I&#8217;m trying to get a little more granular on DB security in Linux and to that end used the MariaDB root user for all LAMP installations is probably not the brightest idea. I&#8217;ll try to commit this to memory but until then I&#8217;ll follow these steps to create a new database and then a new [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[],"class_list":["post-753","post","type-post","status-publish","format-standard","hentry","category-mysql","author-aron"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p4bBkH-c9","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=753"}],"version-history":[{"count":1,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/753\/revisions"}],"predecessor-version":[{"id":755,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=\/wp\/v2\/posts\/753\/revisions\/755"}],"wp:attachment":[{"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/asberry.org\/blog_tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}