{"id":3196,"date":"2020-06-05T04:30:59","date_gmt":"2020-06-04T23:00:59","guid":{"rendered":"https:\/\/www.24x7serversupport.com\/blog\/?p=3196"},"modified":"2023-01-26T17:51:12","modified_gmt":"2023-01-26T12:21:12","slug":"error-connecting-to-mysql-access-denied-for-user-da-admin","status":"publish","type":"post","link":"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/","title":{"rendered":"Error connecting to MySQL: Access denied for user: &#8216;da_admin@localhost&#8217; (Using password: YES)"},"content":{"rendered":"\n<p>When connecting to the MySQL screens in DirectAdmin, if this error appears, that would indicated that the &#8220;da_admin&#8221; user has not been setup correctly. &nbsp;To resolve this do the following.<br>Desired root password:<br>Desired da_admin password:<br><br>1) Make sure the root mysql password works. &nbsp;If you know it, skip to 2). The mysql root password can be found in the \/usr\/local\/directadmin\/scripts\/setup.txt if it has not been deleted. &nbsp;It&#8217;s under the header &#8220;mysql=&#8221;. &nbsp;If it cannot be found, then mysqld will have to be restarted with the &#8211;skip-grant-tables option.<br><br>For MySQL 5.7 and higher on CentOS\/RHEL and Debian\/Ubuntu please use:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl stop mysqld<br>systemctl set-environment MYSQLD_OPTS=\"--skip-grant-tables\"<br>systemctl start mysqld<\/pre>\n\n\n\n<p>For all the other versions of MySQL\/MariaDB:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">service mysqld stop<br>mysqld_safe --skip-grant-tables &amp;<\/pre>\n\n\n\n<p>That should start up mysql without the need for a root password. Type the following to reset the password now for MySQL 5.7 and higher:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql mysql -e \"UPDATE mysql.user SET authentication_string=null WHERE user='root'; FLUSH PRIVILEGES;\"<\/pre>\n\n\n\n<p>For all the other versions of MySQL\/MariaDB:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql mysql -e \"UPDATE mysql.user SET password=PASSWORD('<strong>rootpass<\/strong>') WHERE user='root'; FLUSH PRIVILEGES;\"<\/pre>\n\n\n\n<p>That will reset the root password for you. That will reset the root password for you.<\/p>\n\n\n\n<p>For MySQL 5.7 and higheron CentOS\/RHEL and Debian\/Ubuntu please type the following to unset &#8220;&#8211;skip-grant-tables&#8221; option for the service:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl unset-environment MYSQLD_OPTS<br>systemctl stop mysqld<br>systemctl start mysqld<br>mysql -uroot --connect-expired-password -e \"ALTER USER 'root'@'localhost' IDENTIFIED BY '<strong>rootpass<\/strong>';\"<\/pre>\n\n\n\n<p>For all the other versions of MySQL\/MariaDB type:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">killall -9 mysqld_safe<br>killall -9 mysqld<br>service mysqld start<\/pre>\n\n\n\n<p>2) Once the root mysql password is set and known, then you can begin the process of resetting the da_admin mysql user. Type:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql -uroot -p<\/pre>\n\n\n\n<p>Then press enter. You&#8217;ll be asked for the password. Once in mysql, type:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER USER 'da_admin'@'localhost' IDENTIFIED BY ' <strong>daadminpass <\/strong>';<br>GRANT ALL PRIVILEGES ON *.* TO da_admin@localhost WITH GRANT OPTION;<br>FLUSH PRIVILEGES;<br>quit<\/pre>\n\n\n\n<p>That should set the password for da_admin in mysql.<\/p>\n\n\n\n<p>3) Now we need to make sure it&#8217;s setup correctly for DA to use. Edit \/usr\/local\/directadmin\/conf\/mysql.conf and set<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">user=da_admin\npasswd=<strong>daadminpass<\/strong><\/pre>\n\n\n\n<p>4) Test it out in DirectAdmin.<\/p>\n\n\n\n<p>Some system have a \/root\/.my.cnf file with a preset password. This will override the value set in DA. If you&#8217;re getting a similar error during backups or restores, try deleting or renaming your \/root\/.my.cnf so that it doesn&#8217;t conflict.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When connecting to the MySQL screens in DirectAdmin, if this error appears, that would indicated that the &#8220;da_admin&#8221; user has not been setup correctly. &nbsp;To resolve this do the following.Desired root password:Desired da_admin password: 1) Make sure the root mysql password works. &nbsp;If you know it, skip to 2). The mysql root password can be [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":3569,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[273],"tags":[],"class_list":["post-3196","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-directadmin"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Error connecting to MySQL: Access denied for user: &#039;da_admin@localhost&#039; (Using password: YES) | 24x7serversupport Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Error connecting to MySQL: Access denied for user: &#039;da_admin@localhost&#039; (Using password: YES) | 24x7serversupport Blog\" \/>\n<meta property=\"og:description\" content=\"When connecting to the MySQL screens in DirectAdmin, if this error appears, that would indicated that the &#8220;da_admin&#8221; user has not been setup correctly. &nbsp;To resolve this do the following.Desired root password:Desired da_admin password: 1) Make sure the root mysql password works. &nbsp;If you know it, skip to 2). The mysql root password can be [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/\" \/>\n<meta property=\"og:site_name\" content=\"24x7serversupport Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-06-04T23:00:59+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-26T12:21:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/06\/mysql-error-could-not-connect-to-mysql-10061.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"352\" \/>\n\t<meta property=\"og:image:height\" content=\"164\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"24x7support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:site\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"24x7support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/\",\"name\":\"Error connecting to MySQL: Access denied for user: 'da_admin@localhost' (Using password: YES) | 24x7serversupport Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/06\/mysql-error-could-not-connect-to-mysql-10061.jpg?fit=352%2C164&ssl=1\",\"datePublished\":\"2020-06-04T23:00:59+00:00\",\"dateModified\":\"2023-01-26T12:21:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/06\/mysql-error-could-not-connect-to-mysql-10061.jpg?fit=352%2C164&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/06\/mysql-error-could-not-connect-to-mysql-10061.jpg?fit=352%2C164&ssl=1\",\"width\":352,\"height\":164,\"caption\":\"Error connecting to MySQL\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.24x7serversupport.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Error connecting to MySQL: Access denied for user: &#8216;da_admin@localhost&#8217; (Using password: YES)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/\",\"name\":\"24x7serversupport Blog\",\"description\":\"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\",\"name\":\"24x7support\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Error connecting to MySQL: Access denied for user: 'da_admin@localhost' (Using password: YES) | 24x7serversupport Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/","og_locale":"en_US","og_type":"article","og_title":"Error connecting to MySQL: Access denied for user: 'da_admin@localhost' (Using password: YES) | 24x7serversupport Blog","og_description":"When connecting to the MySQL screens in DirectAdmin, if this error appears, that would indicated that the &#8220;da_admin&#8221; user has not been setup correctly. &nbsp;To resolve this do the following.Desired root password:Desired da_admin password: 1) Make sure the root mysql password works. &nbsp;If you know it, skip to 2). The mysql root password can be [&hellip;]","og_url":"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/","og_site_name":"24x7serversupport Blog","article_published_time":"2020-06-04T23:00:59+00:00","article_modified_time":"2023-01-26T12:21:12+00:00","og_image":[{"width":352,"height":164,"url":"https:\/\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/06\/mysql-error-could-not-connect-to-mysql-10061.jpg","type":"image\/jpeg"}],"author":"24x7support","twitter_card":"summary_large_image","twitter_creator":"@24x7serversuppo","twitter_site":"@24x7serversuppo","twitter_misc":{"Written by":"24x7support","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/","url":"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/","name":"Error connecting to MySQL: Access denied for user: 'da_admin@localhost' (Using password: YES) | 24x7serversupport Blog","isPartOf":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/#primaryimage"},"image":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/06\/mysql-error-could-not-connect-to-mysql-10061.jpg?fit=352%2C164&ssl=1","datePublished":"2020-06-04T23:00:59+00:00","dateModified":"2023-01-26T12:21:12+00:00","author":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401"},"breadcrumb":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/#primaryimage","url":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/06\/mysql-error-could-not-connect-to-mysql-10061.jpg?fit=352%2C164&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/06\/mysql-error-could-not-connect-to-mysql-10061.jpg?fit=352%2C164&ssl=1","width":352,"height":164,"caption":"Error connecting to MySQL"},{"@type":"BreadcrumbList","@id":"https:\/\/www.24x7serversupport.com\/blog\/error-connecting-to-mysql-access-denied-for-user-da-admin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.24x7serversupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Error connecting to MySQL: Access denied for user: &#8216;da_admin@localhost&#8217; (Using password: YES)"}]},{"@type":"WebSite","@id":"https:\/\/www.24x7serversupport.com\/blog\/#website","url":"https:\/\/www.24x7serversupport.com\/blog\/","name":"24x7serversupport Blog","description":"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401","name":"24x7support","url":"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2020\/06\/mysql-error-could-not-connect-to-mysql-10061.jpg?fit=352%2C164&ssl=1","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3196","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/comments?post=3196"}],"version-history":[{"count":2,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3196\/revisions"}],"predecessor-version":[{"id":3200,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/3196\/revisions\/3200"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media\/3569"}],"wp:attachment":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media?parent=3196"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/categories?post=3196"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/tags?post=3196"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}