{"id":388,"date":"2023-05-29T13:06:37","date_gmt":"2023-05-29T13:06:37","guid":{"rendered":"https:\/\/www.devopsfreelancer.com\/blog\/?p=388"},"modified":"2023-05-29T13:06:38","modified_gmt":"2023-05-29T13:06:38","slug":"database-connection-mysqlprojects-not-configured","status":"publish","type":"post","link":"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/","title":{"rendered":"Database connection [mysqlProjects] not configured."},"content":{"rendered":"\n<p>In this tutorial im going to solve this Database connection [mysqlProjects] not configured. This issue is coming when you call another microservice data. <\/p>\n\n\n\n<p>Error:- <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Database connection &#91;mysqlProjects] not configured. {\"exception\":\"&#91;object] (InvalidArgumentException(code: 0):<\/code><\/pre>\n\n\n\n<p>Solution:- <\/p>\n\n\n\n<p>1st step :- go to model and paste code as per below.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\r\n\r\nnamespace App;\r\n\r\nuse Illuminate\\Database\\Eloquent\\Model;\r\n\r\nclass Webdata extends Model\r\n{\r\n    protected $connection = 'mysqlProjects';\r\n    protected $table = 'projects';\r\n}\r\n<\/code><\/pre>\n\n\n\n<p>2nd Step :- Go to config\/database.php and paste below code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>'mysqlProjects' => &#91;\r\n            'driver' => 'mysql',\r\n            'host' => env('DB_HOST_PROJECTS_COUNT', '127.0.0.1'),\r\n            'port' => env('DB_PORT_PROJECTS_COUNT', '3306'),\r\n            'database' => env('DB_DATABASE_PROJECTS_COUNT', 'forge'),\r\n            'username' => env('DB_USERNAME', 'forge'),\r\n            'password' => env('DB_PASSWORD', ''),\r\n            'unix_socket' => env('DB_SOCKET', ''),\r\n            'charset' => 'utf8mb4',\r\n            'collation' => 'utf8mb4_unicode_ci',\r\n            'prefix' => '',\r\n            'strict' => false,\r\n            'engine' => null,\r\n        ],<\/code><\/pre>\n\n\n\n<p>Next go to .env and paste below code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>DB_CONNECTION_PROJECTS_COUNT=mysql\r\nDB_HOST_PROJECTS_COUNT=127.0.0.1\r\nDB_PORT_PROJECTS_COUNT=3306\r\nDB_DATABASE_PROJECTS_COUNT=wz-projects-ms\r\nDB_USERNAME_USER_COUNT=root\r\nDB_PASSWORD_ORGANISATION_TYPE_COUNT=\r\nDB_CONNECTION_ORGANISATION_COUNT=mysql\r\nDB_HOST_PROJECTS_COUNT=127.0.0.1\r\nDB_PORT_PROJECTS_COUNT=3306<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"408\" src=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71-1024x408.png\" alt=\"\" class=\"wp-image-389\" srcset=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71-1024x408.png 1024w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71-300x120.png 300w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71-768x306.png 768w, https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71.png 1342w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Next put in .env file below code.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SD_PROJECTS_MS_BASE_URL=http:\/\/wz-projects-ms\r\nSD_PROJECTS_MS_OAUTH_TOKEN_URL=\/oauth\/token\r\nSD_PROJECTS_MS_GRAND_TYPE=client_credentials\r\nSD_PROJECTS_MS_CLIENT_ID=10\r\nSD_PROJECTS_MS_SECRET=P0uKdreAIHfUeXUdgaHrDyCUH1MvzWynF437SLPy\r\nSD_PROJECTS_MS_ALL_URL=\/api\/v1\/j\/project\r\nSD_PROJECTS_MS_STORE_URL=\/api\/v1\/j\/project\/store\r\nSD_PROJECTS_MS_DELETE_URL=\/api\/v1\/j\/project\/destroy\r\nSD_PROJECTS_MS_EDIT=\/api\/v1\/j\/project\/edit\r\nSD_PROJECTS_MS_UPDATE=\/api\/v1\/j\/project\/update\r\n<\/code><\/pre>\n\n\n\n<p>Now All configuration set properly and its working fine.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial im going to solve this Database connection [mysqlProjects] not configured. This issue is coming when you call another microservice data. Error:- Solution:- 1st step&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[126,127,128,125],"class_list":["post-388","post","type-post","status-publish","format-standard","hentry","category-laravel","tag-database-issue","tag-database-not-configured","tag-invalidargumentexception","tag-mysqlprojects"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Database connection [mysqlProjects] not configured. - DevOps Freelancer<\/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.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Database connection [mysqlProjects] not configured. - DevOps Freelancer\" \/>\n<meta property=\"og:description\" content=\"In this tutorial im going to solve this Database connection [mysqlProjects] not configured. This issue is coming when you call another microservice data. Error:- Solution:- 1st step...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/\" \/>\n<meta property=\"og:site_name\" content=\"DevOps Freelancer\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/amitsthakurs\/\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-29T13:06:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-29T13:06:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71-1024x408.png\" \/>\n<meta name=\"author\" content=\"Amit Kumar\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/amits_thakurs\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Amit Kumar\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/\",\"url\":\"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/\",\"name\":\"Database connection [mysqlProjects] not configured. - DevOps Freelancer\",\"isPartOf\":{\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71-1024x408.png\",\"datePublished\":\"2023-05-29T13:06:37+00:00\",\"dateModified\":\"2023-05-29T13:06:38+00:00\",\"author\":{\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/#primaryimage\",\"url\":\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71.png\",\"contentUrl\":\"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71.png\",\"width\":1342,\"height\":535},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.devopsfreelancer.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Database connection [mysqlProjects] not configured.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/#website\",\"url\":\"https:\/\/www.devopsfreelancer.com\/blog\/\",\"name\":\"DevOps Freelancer\",\"description\":\"We provide DevOps | SRE | DevSecOps | MLOps Freelancing\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.devopsfreelancer.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b\",\"name\":\"Amit Kumar\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g\",\"caption\":\"Amit Kumar\"},\"description\":\"Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer\/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.\",\"sameAs\":[\"https:\/\/www.facebook.com\/amitsthakurs\/\",\"https:\/\/www.instagram.com\/amits_thakurs\/\",\"https:\/\/www.linkedin.com\/in\/amits-thakurs\/\",\"https:\/\/x.com\/https:\/\/twitter.com\/amits_thakurs\"],\"url\":\"https:\/\/www.devopsfreelancer.com\/blog\/author\/amit\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Database connection [mysqlProjects] not configured. - DevOps Freelancer","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.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/","og_locale":"en_US","og_type":"article","og_title":"Database connection [mysqlProjects] not configured. - DevOps Freelancer","og_description":"In this tutorial im going to solve this Database connection [mysqlProjects] not configured. This issue is coming when you call another microservice data. Error:- Solution:- 1st step...","og_url":"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/","og_site_name":"DevOps Freelancer","article_author":"https:\/\/www.facebook.com\/amitsthakurs\/","article_published_time":"2023-05-29T13:06:37+00:00","article_modified_time":"2023-05-29T13:06:38+00:00","og_image":[{"url":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71-1024x408.png","type":"","width":"","height":""}],"author":"Amit Kumar","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/amits_thakurs","twitter_misc":{"Written by":"Amit Kumar","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/","url":"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/","name":"Database connection [mysqlProjects] not configured. - DevOps Freelancer","isPartOf":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/#primaryimage"},"image":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/#primaryimage"},"thumbnailUrl":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71-1024x408.png","datePublished":"2023-05-29T13:06:37+00:00","dateModified":"2023-05-29T13:06:38+00:00","author":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b"},"breadcrumb":{"@id":"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/#primaryimage","url":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71.png","contentUrl":"https:\/\/www.devopsfreelancer.com\/blog\/wp-content\/uploads\/2023\/05\/image-71.png","width":1342,"height":535},{"@type":"BreadcrumbList","@id":"https:\/\/www.devopsfreelancer.com\/blog\/database-connection-mysqlprojects-not-configured\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.devopsfreelancer.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Database connection [mysqlProjects] not configured."}]},{"@type":"WebSite","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#website","url":"https:\/\/www.devopsfreelancer.com\/blog\/","name":"DevOps Freelancer","description":"We provide DevOps | SRE | DevSecOps | MLOps Freelancing","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.devopsfreelancer.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/22ed4bd82dc04200a2ca541b3e35fc5b","name":"Amit Kumar","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.devopsfreelancer.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d76fb4d0f15f7a458f1fd91063b44fbb7e7eb9e724b1c465d885054c2540250f?s=96&d=mm&r=g","caption":"Amit Kumar"},"description":"Hi I am Amit Kumar Thakur Experienced as s Software Developer with a demonstrated history of working in the information technology and services industry. Skilled in HTML, CSS, Bootstrap4, PHP, Laravel-9 , REST API,FB API,Google API, Youtube Api, Bitbucket,Github,Linux and jQuery. Strong engineering professional focused in Computer\/Information Technology Administration and Management. Currently my profile is to Software Developer, analyze the requirement, creating frame for web application, coding and maintenance.","sameAs":["https:\/\/www.facebook.com\/amitsthakurs\/","https:\/\/www.instagram.com\/amits_thakurs\/","https:\/\/www.linkedin.com\/in\/amits-thakurs\/","https:\/\/x.com\/https:\/\/twitter.com\/amits_thakurs"],"url":"https:\/\/www.devopsfreelancer.com\/blog\/author\/amit\/"}]}},"_links":{"self":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/388","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/comments?post=388"}],"version-history":[{"count":1,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/388\/revisions"}],"predecessor-version":[{"id":390,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/posts\/388\/revisions\/390"}],"wp:attachment":[{"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/media?parent=388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/categories?post=388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsfreelancer.com\/blog\/wp-json\/wp\/v2\/tags?post=388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}