Question

Connecting to the database

Im trying to connect to the database using DB navigator in phpDesigner.

I can already connect to my database with php and PDO using localhost as the host and the username and password setup through PHPmyadmin. I dont understand why that works since my database is stored on Digital Oceans VPS but it works, i can write to and from the database no problem and access my database at www.mywebsite/phpadmin

normally when localhosts works it means i have LAMP installed on my local machine but i dont and when i worked previously with shared hosting for another site the host was the ip address.

Anyway i didnt worry about it but now im trying to use DB navigator with PHPstorm and it needs to setup the database connection. since im using the same username and password that works for php connection to the database i assume that is correct.

I have installed the driver library and selected the .com.mysql.jdbc.Driver as the driver. for URL which i assume must be host i have tried the following:

pretend droplet ip = 123.456.789 jdbc:mysql://localhost:3306 jdbc:mysql://123.456.789:3306 jdbc:mysql://mywebsite.com:3306 jdbc:mysql://www.mywebsite.com:3306

None of these work and all say no packets recieved. Anyone know what the correct connection string is?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

no my.cnf folder

Is MySQL listening on 127.0.0.1? Edit <code>/etc/mysql/my.cnf</code> and set the <code>listen</code> directive to <code>0.0.0.0</code> <br> <br>Save the file and restart MySQL: <br> <br><pre>sudo service mysql restart</pre> <br> <br>Make sure you also allow ‘username’@‘yourcomputersipaddress’ to access MySQL: <br> <br>https://www.digitalocean.com/community/articles/how-to-create-a-new-user-and-grant-permissions-in-mysql

sorry should have pointed out this is with PHP storm not php designer like i initially said