SQLyog Help File
Overview of SQLyog
SQLyog is a easy to use, lightweight and compact graphical tool to manage your MySQL database anywhere in the world. With SQLyog you can -
This document is the most updated help for version 1.71. If you have a more recent version then download the recent help from the Webyog website.
About this manual
This manual is available only in HTML format. We are planning to come out with other format in future. Till then this document contains all the information you want to know about SQLyog. If you have any queries, questions or suggestion about SQLyog please mail them to support@webyog.com
Pricing
SQLyog is a freeware software. You can you use it without any restrictions.
Downloading and using SQLyog
Download the self-extraction zip file from the webyog site. Unzip all its content -
to a directory say c:\SQLyog and run the exe.
This release does not have any setup files or such because we have tried to make the software as simple as possible with no overheads. If you don't want to use the software just delete the directory into which you had copied the files.
What's New in SQLyog 1.71
There have been lot of changes from the previous version i.e. 0.9. Here is the list of some of the major changes implemented in 1.71.
New Features |
|
Improvements |
|
Bug Fixes |
|
With so many changes its a must update from 0.9.
Getting started with SQLyog
After you have unzipped the file. Run SQLyog.exe. The first
thing you will get is Fig. 1. Fill in all
the details about the server you want to connect i.e. host
address , user name, password and the port number. If you don't give any details
SQLyog will try to connect to localhost with the default user and port number
3306. You must connect to database successfully before you can perform any activities
with the software.
After you have connected to an instance of MySQL, you can make additional connections by selecting the New Connection option from the File menu.
Hardware / Software Requirement
Here are the list of software and hardware under which SQLyog has been found to work perfectly -
The software has been tested in machines having memory ranging
from 64 MB to 256 MB and processors ranging from 166 MHz to 1.4 GHz with OS
Win 95/98/XP/2000.
As of now the SQLyog runs only under Windows. We are planning to come with a OS independent version.
Using SQLyog Windows
After you have established a connection you will get a window like Fig. 2. The name in the image signifies the name with each window will be referred to in this document.
The following table lists the icons in the SQLyog toolbar.
![]() |
Inserts a new template in the SQL window of the current active connection. |
![]() |
New instance of a connection |
![]() |
Open a SQL script file (.SQL) in the SQL window of the current active connection. |
![]() |
Save the SQL script into a .SQL file. |
![]() |
Cut the selected text. |
![]() |
Copy the selected text into the clipboard. |
![]() |
Paste from clipboard. |
![]() |
Execute the query or queries from the SQL window in the active connection. Clicking it will give you three options. You can select to execute the current query which you are writing, or selected query(s) or all the queries in one batch. |
![]() |
Refresh the Object Browser for the current active connection. |
![]() |
Can change the database for the current connection. |
Title Window
The title window shows the database name and the user name to current connection. If the query has been saved then it shows the complete path of the SQL file.
Object Browser Window
The window gives you the complete detail of the server you are connected to in a tree format. In the top you will see the user@servername and all the database.
Starting from 1.71, the object browser wont retrieve the whole data about a server in one instance. It will first show only the databases and when you expand it, it will retrieve the table names only. When you expand the table name it will retrieve data about the table. This reduces time as SQLyog has to retrieve only necessary data when required. It is also efficient on memory.
Remember, retrieval of data takes place only for the first time. After that a cache is maintained. To get the latest information you have to refresh the Object Browser.
Expanding database node will show the tables in the database and expanding the table name node will show the columns and indexes available for the table.
You can refresh the object browser with the latest detail about the server whenever you want by right clicking on the window and selecting Refresh Object Browser or by pressing F9. When you refresh the object browser SQLyog tries to get you back to the last selected item. The precision of it depends upon the changes done in the server before and after Refreshing.
The popup menu also has other options - Drop Database, Drop Table, Insert Statement For The Table, New Table In The Database. More about them later.
SQL Window
It is here where you write your SQL commands which you want execute. Write any SQL query and press F5 to get the result of the query. There are various ways to enter SQL in the window -
The SQL window provides you with various commands to help you write SQL commands, including the standard editing commands : Undo, Cut, Copy, Paste and Select All. You can also force case, insert and remove comment marks.
If you are executing multiple queries then separate the individual queries by a (;). Otherwise the software will take it as a single query and you might get an error even if there is no error with the SQL. Each query would create a new tab for its resultset.
From 1.71, you can execute queries in SQLyog in three ways.
SQL window supports syntax highlighting for better usability. The different color signifies different element of SQL -
|
Signifies tablename, database name etc. Word with this color means its not a reserved word in MySQL. |
Signifies its a keyword in MySQL. E.g. select, update, insert etc. | |
Signifies its a function provided by MySQL. E.g. ifnull etc. | |
Signifies the word is part of comment. More about comment. | |
Signifies its a string value. | |
Signifies its a operator. Eg. =,+,-, etc. |
Fig.3 ( example of single query). Fig. 4 ( example of multiple query ).
Note : If you are executing only one query then you don't have to end it with a (;). You can just execute them. Putting a (;) wont have any effect. The application uses it as a separator between queries.
ResultMessage Window
This window shows you the resultset or messages returned due to the execution of the query. The window has two tabs - Results and Messages.
Selecting Results tab will show you the resultset returned by the query. If you have executed multiple queries which returns resultset then you will see multiple Records tab in the window with the resultsets of the respective queries attached to it. Therefore, the first tab will hold the result of the first query and second for the second query and so on. To view the results just select the respective tab.
Selecting the Messages will show you the messages or results of all the queries you have executed. This includes the error for the query (if any), number of rows returned by the resultset or number of rows modified by INSERT / DELETE / UPDATE etc. statements. For multiple queries, individual messages will be shown with each message terminated by a newline. Click Fig. 5 for a sample.
Note : SQLyog does not stop executing query if there is an error in one query within multiple queries. It will execute all the queries and then will show you the results. So maybe sometimes you wont get the resultset in the tab in which you expected. The tabs contains resultset of only the successful queries.
SQLyog Status Bar
The status bar has two parts. It displays -
Query Window Status Bar
The status bar has four parts. It displays -
SQLyog Keyboard Shortcuts
Keeping in mind about the preference of developers for keyboard, SQLyog incorporates many keyboard shortcuts for fast working with the application. Following is the complete list of all keyboard shortcuts available in SQLyog.
F5 | Execute the current query. |
F9 | Refresh the Object Browser. |
F1 | Show the help file. |
Alt + 1 | Hides / Shows the object browser. |
Ctrl + 1 | Selects the first tab in the Result/Message tab window. |
Ctrl + 2 | Selects the second tab in the Result/Message tab window. |
Ctrl + 3 | Selects the third tab in the Result/Message tab window. |
Ctrl + 4 | Selects the fourth tab in the Result/Message tab window. |
Ctrl + 5 | Selects the fifth tab in the Result/Message tab window. |
Ctrl + B | It sets the focus on the Object Browser window. |
Ctrl + E | It sets the focus on the SQL Editor window. |
Ctrl + R | It sets the focus on the Result Window. |
Ctrl + F |
Opens up the find window so that you can find a particular text in the SQL Editor as well as in the Result Window. ( For this option to work in Result Window you need to be in Result In Text Mode ) |
Ctrl + H | Opens up the Find / Replace window. |
Ctrl + N | Opens up a new connection window. |
Ctrl + S | Save the current SQL into a file. |
Ctrl + O | Open a saved SQL file in the current connection. |
Ctrl + L | Switch between Result in Text / Grid mode. |
Ctrl + V | Paste from clipboard in the SQL editor. |
Ctrl + F4 | Close the current connection window. |
Ctrl + F5 | Execute the currently
selected query. ( Pressing only F5 has the same result ). |
Shift + F5 | Execute all the queries. |
Ctrl+Shift+C | Comment the current selected SQL in the editor. |
Ctrl+Shift+R | Remove the comment
in the current line. ( The option only uncomments text beginning with comment style -- ). |
Ctrl+Shift+L | Convert all the selected text to lowercase. |
Ctrl+Shift+U | Convert all the selected text to uppercase. |
Ctrl+Shift+P | Open the Personal Folder menu in the current cursor position. |
Ctrl+Shift+T | Open up the Template dialog box. |
Ctrl+Shift+E | Opens up the Export Data dialog box. |
You can get the above list by selecting Help / Keyboard
Shortcuts in SQLyog.
Comments in SQLyog
SQLyog supports three types of comments in the query.
Some of the valid comments are -
Something more about SQL window
This section describes some task that can be performed in the SQL window.
Moving and Copying Text
Undoing Mistakes
To Remove All the Text in the Window
Change the Case of Text in Window
Note : The feature will work only with characters. Any special character wont be affected.
Adding and Removing Comments
Note : Even if you don't select the whole text in a line, the line will be commented out. So you can only comment or uncomment the whole line with this option. To comment multiple line, select multiple lines.
Using Templates in SQLyog
Templates tells you the basic skeleton of the SQL statement. Looking into it you can form your own statements.
Something more about Object Browser
With addition to view the database details, the object browser can be used to perform some other tasks also. To get a list of tasks which can be performed select any item and right click on it. The various options in the popup menu are -
Table Maker
To create a new table click on New Table In The Database in the Object Browser popup menu.
Fill in the columns as appropriate. Each row represents one column in the table.
Right click on any row and you get a context menu. Through this you can set a column as Primary Key.
To delete or insert one row in between right click and select option as required.
After giving all the details select Create Table button from the toolbar. In the Give Name dialog box give a name for the table and select the type of table you want to create. Before clicking on the option, make sure that you don't have any empty column in between because SQLyog starts traversing for columns from the top column and traverses till it encounters a empty column. So leaving a row blank will have undefined behavior.
If any error occurs while creating the table, the error will be shown in a messagebox.
Click here to get a view of Table Maker Fig. 6.
Blob Window
If any field in your resultset has a BLOB value column then SQLyog will only show [BLOB] in the column. Double clicking on it will result in a dialog box coming up with the value of that column. SQLyog supports binary data as well as BLOB field. It can show image files of JPEG/GIF/PNG type. For other binary data it will show some garbage value in the BLOB field dialog box.
Click here for a sample of variable length field, Fig. 7.
Click here for a sample of image data field, Fig. 8.
Personal Folder
You can save your most commonly used SQL scripts in the Personal Folder of SQLyog. It relives you from the task of saving and opening of a SQL file in your local storage. With the click of mouse you have an access to your most important scripts.
SQLyog stores all your personal folder files in the directory in which you unzipped the executable. It stores it in the (.mys) extension so you should never fiddle with it.
Saving SQL in Personal Folder
After you have written your SQL scripts in the SQL window you can add them into the personal folder by following the given steps -
Inserting From Personal Folder
To insert a file from the Personal Folder follow the steps -
Managing Your Personal Folder
You can manage your Personal Folder by selecting Edit/Manage Personal Folder or selecting Manage Personal Folder from the context menu of the SQL window.
When you select the option you get a dialog box like Fig. 10, check the keys which you want to delete and press Delete. The files will be deleted and the Personal Folder Menu will be updated accordingly.
Note : Once you delete the file you cant get it back because SQLyog doesn't have any temporary deletion facility. So be sure that you want to delete the script.
Exporting Data
SQLyog provides the facility to export your resultset in XML, HTML and CSV format. To export any resultset, select the respective Results tab and select Transform/Export Data and select the format in which you want to save it. You will be prompted to give the file path and the file name. Give the details and your file will be saved.
You cant save multiple resultsets in one go. To save multiple resultsets select the respective Results tab and save them accordingly.
Note : If you have selected Save in CSV, SQLyog saves the data where the columns are separated by (,) and lines are separated by ( \r\n ).
Exporting Data In Clipboard
With SQLyog you can copy the whole of result set or selected rows in clipboard in CSV format. To copy all the result in the memory just right click on the Result Window and select Copy Data To Clipboard option from the context menu.
For copying only selected rows into Clipboard, select the particular rows by clicking on the rows by pressing SHIFT and then select Copy Selected Data To Clipboard.
Exporting Tables
You can export the whole of table with all its structures and data by selecting Import/Export/Export Tables option. When you select the option, you get a dialog box like Fig. 11.
Select the database for which you want to export the data. Selection of a database will show you its respective Tables, select the tables for which you want to export the data. Check the various options, select the file and press Export.
Importing From CSV File
SQLyog provides with the facility to import data into your table from a CSV file. To import a file select Transform/Import From Textfile and you will get a dialog box like Fig. 12.
Select the database, tablename and the columns and file all the required information. You should provide atleast how fields and lines are separated. By default they are (,) and ( \r\n ). If you have a file with different format then you can change it with updated details and SQLyog will import data in that format.
Note : This option will only work for MySQL versions > 3.22.6 because SQLyog uses the LOAD LOCAL INFILE command to import data. For MySQL versions less then 3.22.6 you will get a error.
Flush Manager
To flush Host / Logs / Privileges / Tables / Tables With Read Lock / Status, select the appropriate option from the Flush dialog box in Tools menu.
Table Diagnostics
To run a quick check on your database and tables, you can use SQLyog Table Diagnostics option. Fig. 13 shows the Table Diagnostics dialog box.
In the dialog box select the database and the table which you want to diagnose and select the type of diagnosis you want to do on the table. After the diagnosis you will get the report in Results listview.
FAQ
Check out the latest FAQ page at SQLyog FAQ Page.