MYSQL database or SQL Server database

Guys, could you please help me on this?
First of all, i don’t know the difference between accessing data one way or the other. Second, i have an sql server name to access and as well as user name and password. I also have the name of the tables to access, although i would like to access them all.
Can anyone help me on this one?
Thanks in advance

Hi Pedro. We’ll need a little more to go on to answer this. What exactly is your question? What do you mean by “one way or the other”? For SQL Server, for example, if the credentials you have give you access to the server and database and table within that database, then you can easily use them to get the tables inside of Power BI; I’m not experienced with MYSQL so can’t say anything about it. Greg

hello @ edroccamara -

for sql data base use the following link to conect

for sql anywhere you can use the following link. this is an old link but has a lot of info

It is important that you understand where the sql server is stored - on prem on azure or on cloud…
also a lot of difference between mysql and sql server.

once you have some more info, pls write back and can help yo then.

thank you

Hi @Greg
Thank you for trying to help me. My question is a simple one: when to use MySQL database and when to use SQL Server database. I have all the info i need to connect through PBI and i think i shold connect through SQL Server database but it’s not working. That’s why asked what’s the difference between them, to try to understand why can’t i connect

Hey @C9411010
I believe the data is store on a cloud. For sure is not on azure. But i don’t know if it’s on prem (don’t know what that means).
They gave me the number of the server adress, (192.168.X.XXX\primavera), a user name and a password.
I’ve tried both ways (MySql and SQL Server) and it didn’t work)
Maybe the server is disconnected? I know it’s weird, but it happen to me in the past…

can you ping the server 192.168.X.XXX\primavera

can you connect to the sql server using a traditional tool like sql server management studio. ? i would suggest, before even trying to connect with power bi try to connect using a traditional sql server traditional tool.

by the way looking at your error message, that is the typical message you get when you cannot connect to the sql server. either you do not have the right name of the server or there is an error with your user id and password…

Forgot to mention - when the data is stored in the cloud there may be firewall rules that allows only machines within certain IP ranges to connect to the sql server. that could be another area where you may want to check with your cloud hosting company or a colleague who can successfully connect to the database.

thanks and all the best.

Guys, i’m so sorry to boder you guys but the problem was on the “other side”. All it’s working now. I’m very sorry for wasting your time. Thanks a lot

Glad it worked out … marked your last post as the solution.

1 Like

Sure, I can help you with that.

To access data from a SQL Server database in a program, you can use a database driver for the programming language you are using. Most popular programming languages have database drivers available for SQL Server.

Here’s an example in Python using the pyodbc library to access a SQL Server database. First, you’ll need to install the pyodbc library by running pip install pyodbc.

import pyodbc

Set up the database connection

server = ‘your_server_name’
database = ‘your_database_name’
username = ‘your_username’
password = ‘your_password’
connection = pyodbc.connect(f’DRIVER={{ODBC Driver 17 for SQL Server}};SERVER={server};DATABASE={database};UID={username};PWD={password}')

Query the database

cursor = connection.cursor()
cursor.execute(‘SELECT * FROM your_table_name’)
rows = cursor.fetchall()

Print the results

for row in rows:

In this example, pyodbc is used to create a connection to the SQL Server database using the provided server name, database name, username, and password. Then, a SQL query is executed using the execute() method on the cursor, and the results are fetched using the fetchall() method. Finally, the lead data enrichment and the results are printed.

You can modify the SQL query to select specific columns or tables if you don’t want to retrieve all the data. For example:

Select specific columns from a table

cursor.execute(‘SELECT column1, column2 FROM your_table_name’)

Select all columns from a specific table

cursor.execute(‘SELECT * FROM your_table_name’)