Ravindra Bagale · Power BIसर्व coursesया course चे lessonsशोधाEnglish

Power BI · मराठी आवृत्ती

4.5 MySQL ला connect करूया

रवींद्र बागले यांच्या course वर आधारित · सहज मराठीत explanation

अनेक web apps MySQL वापरतात. Power BI मधल्या MySQL connector साठी आवश्यक driver आधी install करावा लागतो.

  1. Official MySQL website वरून MySQL Connector/NET घ्या. चालू Microsoft connector documentation मध्ये supported असलेलं version वापरा. Install नंतर Desktop restart करा.
  2. Home › Get data › More… › Database › MySQL database › Connect निवडा.
  3. Server: qc-mysql.example.com:3306 किंवा localhost:3306. Database: quickcommerce.
  4. गरजेनुसार Command timeout, SQL statement, Include relationship columns आणि Navigate using full hierarchy हे Advanced options वापरा.
  5. Database credentials मध्ये pbi_reader सारखा user आणि password द्या.
  6. Navigator मधून tables निवडा आणि Transform Data करा.
  7. Gateway मार्फत refresh करणार असाल तर gateway machine वरही योग्य driver install करा.

खाली MySQL चं उदाहरण आहे. Backticks आणि LIMIT लक्षात घ्या. ORDER BY सोबत LIMIT असल्यामुळे इथे सर्वांत अलीकडच्या 1000 rows निवडल्या जातात.

SELECT o.order_id, o.order_datetime, s.city, s.area, o.amount, o.delivery_time_mins
FROM   `orders` o
JOIN   `dark_store` s ON s.store_id = o.store_id
WHERE  s.city IN ('Pune','Solapur','Nashik','Sambhaji Nagar','Kolhapur','Nagpur')
ORDER BY o.order_datetime DESC
LIMIT 1000;
Errorसंभाव्य कारणकाय तपासायचं?
Additional components requiredConnector/NET नाहीDriver install करून Desktop restart करा.
Unable to connect to MySQL hostsServer / port चुकीचा, server बंद किंवा firewallServer:port तपासा; admin कडून network access तपासून घ्या.
Access denied for userPassword चुकीचा किंवा host ला परवानगी नाहीयोग्य credentials आणि host permissions मागा.
SSL/TLS / certificate errorEncryption settings mismatchAdmin सोबत SSL settings तपासा.
Desktop चालतं, Service failGateway driver किंवा credentials अपूर्णGateway वर driver व connection configure करा.

MySQL साठी उपलब्ध connectivity modes चालू Microsoft documentation मध्ये तपासा. Import आणि scheduled refresh हा नेहमीचा वापर आहे.

Practice

Local MySQL Community Server मध्ये orders आणि dark_store तयार करा. Pune व Solapur चा test data वापरून प्रत्येकी दहा rows भरा. Connect करा. नंतर फक्त test connection मध्ये चुकीचा port देऊन error कसा दिसतो ते पाहा आणि योग्य port परत द्या.

अधिक माहिती: Microsoft Learn — MySQL connector.