Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change comment font color in MySQL Workbench query

Is it possible to change the font color from a light grey to something more vibrant

enter image description here

    # GET TODAY'S EVENTS ONLY <- this is the font I want to change
    where event_date = CURDATE();

I am currently using MySQL Workbench version 6.0.9.11421 on Windows 7 OS

like image 303
Karl Cooney Avatar asked Oct 16 '14 09:10

Karl Cooney


People also ask

How do I change the font color in SQL Server management studio?

There is only one font setting for the Editor and it affects all editors in SQL Server Management Studio. You can change the color based on the text type (such as comments and statements). Monospace fonts appear in bold in the Font list, and you can apply bold settings on a per-text-type basis.

Is there a way to change the color of MySQL Workbench code?

These colors are stored in an xml file and there's currently no GUI to change them. But you can edit the xml file directly (restart MySQL Workbench to pick up any change). Look for the file code_editor.xml in your MySQL Workbench installation directory. <?xml version="1.0" encoding="utf-8"?> <languages> <language name="SCLEX_MYSQL"> <!--

How do I change the font size in MySQL Workbench?

"You can edit the preferences directly in their XML files. Shut down MWB. Then edit the file ~/Library/Application Support/MySQL/Workbench/wb_options.xml. Look for the key workbench.general.Editor:Font, and change the font there. Now restart MWB to see your change." Show activity on this post.

How do I change the editor in MySQL Workbench?

Select Preferences from the Edit menu to configure MySQL Workbench to your specific needs. The Workbench Preferences sidebar menu is divided into the following sections: General Editors: General-purpose editor options, such as SQL parsing options.


1 Answers

What you want to change in fact is the colors for syntax highlighting. These colors are stored in an xml file and there's currently no GUI to change them. But you can edit the xml file directly (restart MySQL Workbench to pick up any change). Look for the file code_editor.xml in your MySQL Workbench installation directory.

There are sections for each supported MySQL server like:

<?xml version="1.0" encoding="utf-8"?>
<languages>
  <language name="SCLEX_MYSQL">
    <!-- This is the base language setting. It's usually not directly used, but provides values shared by
         more specialized MySQL versions. -->

    <!-- Lexer properties -->
    <property name="fold" value="1" />
    <property name="fold.compact" value="0" />
    <property name="fold.comment" value="1" />
    ...
    <style id="1" fore-color="#A0A0A0" /> <!-- SCE_MYSQL_COMMENT -->
    <style id="2" fore-color="#A0A0A0" /> <!-- SCE_MYSQL_COMMENTLINE -->
    ...
  </language>
  ...
</languages>

There are a number style tags each specifying a forground and background color (and styling like bold, italic) for each type of token. This is where you can adjust the colors to whatever you like. Make a copy of the original file in case you need to restore it.

like image 77
Mike Lischke Avatar answered Oct 06 '22 01:10

Mike Lischke