1

I wanted to know if this was possible. Hope I'm asking this question the right way.

Can you write SELECT query locally without using the server? I can connect using certificate key and MySQL workbench but can't connect to the database on the server using the same credentials.

I'm using Php but don't know any other way to SELECT table and retrieve data for my React application without writing code on the server in a Php file to access the data?

Mike Lischke
  • 48,925
  • 16
  • 119
  • 181
icode
  • 637
  • 2
  • 10
  • 22
  • basically, you will need to [do query in `php`](https://www.w3schools.com/php/php_mysql_select.asp) then send the result to your `react` - not sure whether react can do sql queries.. btw, what do you mean by ` I can connect using certificate key and MySQL workbench but can't connect to the database on the server using the same credentials.` is it not the good old username-password..? i thought certificates only for secure connection.. – Bagus Tesa Apr 24 '17 at 23:29
  • I'm working with a client and they give me access using SSL to connect remotely to their database. Using MySQL workbench I use this to connect but when I try to connect to the database on the server I get Connection Failed. I know I can write Mysql queries in a Php file but with the connection to the database I thought maybe theirs another way using remote access. I figure writing on the server in a Php file is the only way to pass data to my react app – icode Apr 24 '17 at 23:54
  • Make a php class on another php-based server which do the requests you need, then do ajax with react to retreive all of this. – pirs Apr 25 '17 at 00:02
  • Hi @icode, i suppose you used the `Standard TCP/IP over SSH` in MySQL Workbench right? you will need to make a persistent tunnel to the database server, well, i'm not familiar with this kind of approach. Hope this answer on [Persistent SSH Tunneling](http://stackoverflow.com/questions/464317/connect-to-a-mysql-server-over-ssh-in-php#comment65229024_16138417) can help you. Cheers. – Bagus Tesa Apr 25 '17 at 00:40
  • Yes, I'm using MySQL Workbench. Let me take a look into Persistent SSH Tunneling – icode Apr 25 '17 at 01:01

0 Answers0