Not seeing how to format .sql files for MySQL

We're using MySQL 5.5 but PHPStorm isn't highlighting certain keywords like NEW (like MySQL Workbench does), and I'm not seeing how to make it understand a specific database technology and version number.

9 comments

Did you add a database connection in PhpStorm to let it know about existing DB objects?

Try setting resolution scopes at File | Settings | Languages & Frameworks | SQL Resolution Scopes. You can also check out our Help articles on this: https://www.jetbrains.com/help/phpstorm/relational-databases.html 

 

If none of the above helps please attach screenshots that would illustrate the issue

0

The forum has appended a space at the end of the link, here's the correct one: https://www.jetbrains.com/help/phpstorm/relational-databases.html
Also, answering one of your questions, SQL dialect are not specific to certain DB versions, unfortunately, so they only provide features relevant for the last version.

0

It looks like PHPStorm supports switching to the latest MySQL 5 understanding here:

Am I correct in my assertion? I hope I'm doing this correctly!

0

Oh I just noticed when I selected Latest 5, it just selects 5.1.47... but we're using 5.5, so that won't be good enough.

I read that MySQL 8 supports 5.5, but the problem is that with PHPStorm only supporting up to 5.5, 5.1 will not be aware of enough features for good syntax reading, and 8 will not notify me of things incompatible with 5.5... Very disappointing.

Since the Connector appears to be coming from Java, is there a connector I can download and plug in for 5.5 or other 5.x versions?

0

Pardon me for posting again, I found this: https://dev.mysql.com/downloads/connector/j/

It says "MySQL Connector/J 8.0 is highly recommended for use with MySQL Server 8.0, 5.7, 5.6, and 5.5."... so I will use that.

Maybe I'm just not aware of how this works with PHPStorm... I figured this would allow syntax validation, but maybe I'm not understanding or fully aware of what this actually will do in the programming environment.

0

Newer connector versions let PhpStorm introspect the DB making it aware of built-in functions and such stuff, but not affecting actual inspections - here's an example when it doesn't help: https://youtrack.jetbrains.com/issue/WI-44687

0

That link says 404: Nope, can't find it!

 

0

Sorry, there were limited permissions set on this issue due to uploaded logs and exposed SQL query. So, I changed the sample query and hide logs/screenshot and made this issue open to everyone.

Please try again.

0

Please sign in to leave a comment.