0

I want to access data from a mysql table which is on different database on different machine. Both the machines are connected to same network. I tried access using

select * from [10.1.18.244].dbname.dbo.tablename;

But its giving me syntax error and also I don't know what exactly is dbo and how to find it out?

And, also I found that it can be done using linked server, but I don'tknow how to do this?

Actually I want this in query form only because I want to apply this in Stored Procedure like

DELIMITER //
create definer = 'root'@'10.1.18.244' procedure user_cnt()
sql security invoker
begin 
select * from dbname.tablename;
end //
DELIMITER ;

Any method which will be useful for querying data in events/views/procedures please suggest me.

Divyani Garg
  • 138
  • 1
  • 3
  • 15

1 Answers1

0

<?php $mysqli = new mysqli("localhost", "username", "password", "dbname"); ?>

Localhost using in the Server name or server ip.

and also mysql is differ from sql query.

Naveen S
  • 63
  • 9