MySQL Quicklaunch Trick
You can launch and log into mysql with a very simple batch file!
The Trick
Not a trick really, just a couple of simple DOS Commands placed in a batch file and a little shortcut to that file.
Basically, the batch file will contain the commands that will instruct the operating system to run mysql and to use the predefine credentials to log in. Along the way, we will also modify the working directory, title and maybe even the color scheme: )
Let’s Do It
Open notepad or your text editor of choice and type the following command(s):
MYSQL -uusername -ppassword
That’s really all you need to launch and log into mysql but we can do better:
CD \ TITLE My Title COLOR 0D CLS MYSQL -uusername -ppassword
The first command CD sets the working directory to \ the root
The second command TITLE assigns desired text to the console’s title bar.
The third command COLOR sets the background and foreground color.
The fourth command CLS clears any commands on the console windows.
The most important command MYSQL takes two parameters -u and -p
What Next?
Now that you know about the commands, you can edit them to your specifications. The most important ones are the username and password parameters.
Now just go ahead and save the file as mysql.bat and place it on the desktop or any other folder you desire as long as you remember where you saved it: )
You can now browse to the batch file and click or double click to run it.
Not Fast Enough!
You’re right, we need to create a shortcut to the batch file or place it on the desktop so we can run it as quickly as possible. You can also add the batch file or shortcut to your start menu and your quick launch bar!
More Help!
If you’re not sure what your mysql usename is, odds are that it’s root
Color attributes are specified by TWO hex digits.
The first corresponds to the background and the second corresponds to the foreground. Each digit can be any of the following values:
0 = Black 8 = Gray
1 = Blue 9 = Light Blue
2 = Green A = Light Green
3 = Aqua B = Light Aqua
4 = Red C = Light Red
5 = Purple D = Light Purple
6 = Yellow E = Light Yellow
7 = White F = Bright White
If you have any questions regarding this article, feel free to reach out on twitter
~ Kode @Sciphr
