Please Note, it’s been pointed out that I need to make it clear that this covers version 5.2, the developer release, of MySQL Workbench. The principles still apply to 5.1, but it’s a different process that I’ve not documented at all. Apologies for any confusion.
This is a slight departure from our usual posts as it’s not about WordPress. However, if you’re developing with WordPress on a Windows PC there’s a good chance you’re using XAMPP as your platform.
I always liked the MySQL Administrator and MySQL Query Browser tools, but these have recently been deprecated and will not be updated any more. Instead, MySQL have released the MySQL Workbench, which is an all-in-one style DB tool that includes query browsing, database management and, interestingly, an entity relationship modeller. The latter is useful if you’re designing databases. In WordPress development you don’t do too much of that as it’s designed as a database light application. A shame, because a better DB structure would really extend its power and reduce the frankly vast amount of code that’s invoked. But that’s for another conversation!
Anyway, you’ll get the Workbench application and then find that it’s far harder to get going than the old tools. But don’t be put off, once you work out a few simple steps you’ll be off.
It’s worth noting that this is as new to me as it is to you – there may be better ways to do this, and I’ve made certain assumptions about how you use XAMPP. If you have any feedback, please comment below!
Create a New Server Instance

Start Workbench and you’ll be presented with a dashboard. Select New Server Instance.
Host machine is LocalHost

OS is Windows

You’ll need to check which version of MySQL you have installed – 5 or 5.1
Don’t Worry About the Error

XAMPP uses a .cnf file, not .ini No idea why, just the way they’ve compiled it, I guess. Remember, we’re not running MySQL from a standard build. Just click next.
Connection Values

Click and Open Connection Manager
Create a Connection Called localhost

Assuming you have the default XAMPP for development purposes then you can use the settings exactly as above. If you’ve assigned root a password you’ll need to completely the fields appropriately. Click Test Connection to make sure all is well. I like to use the Local Socket/Pipe, but you can use TCP/IP also.
The next step in the wizard will test the connection. All should be well and if not you’ve made a mistake.
Config File

This is the first point where you deviate from ‘normal’. If you click check path before setting it correctly, nothing will work. So, you need to know where XAMPP is installed. If it’s in the root of your T: drive as it is for our dev machines, then you need to enter the following path: T:\xampp\mysql\bin\my.cnf Change this according to where you placed XAMPP. If you can’t work this path out, maybe you should try a different vocation?
Click Next
Commands to Manage MySQL Server

This is where it gets a little more fun. The first two are quite easy to work out, but the third is quite different to the default. Maybe there’s a better command, but it was the best I could think of at the time.
As you can see, the commands are:
T:\xampp\mysql\bin\mysqld --defaults-file=T:\xampp\mysql\bin\my.cnf --standalone --console
T:\xampp\mysql\bin\mysqladmin --user=pma --password= shutdown
mysqladmin --user=pma --password= ping | findstr alive
You may also want to run the commands in the context of administrator in many cases, but I don’t run on my machine as administrator (I’m security conscious) and don’t have the need to run these as admin, so it’s not strictly necessary to tick the box. But for a development machine this isn’t a worry either way.
Name the Instance

Simples.
Finish off the wizard and you’ll have a new instance. As long as you start MySQL in advance with XAMPP, it will work as expected. Read the note below for more information on why.
A Note About Starting and Stopping
I have to admit that with the current settings I always start MySQL from the XAMPP control panel or shortcuts. If I stop MySQL from the Workbench it can stop it, but it will never notice that it’s stopped. This is less of an issue when you run MySQL as a service, and you can use the default commands given by the wizard, but running Apache and MySQL as a service can be a painful approach with XAMPP so few people bother. If I can find time to work out a slicker approach, or you can tell me of one, then I’ll update this guide.
I hope this guide has been useful. Thanks for reading!
by
Xampp have two scripts for start and stop mysql, this option work fine in xampp 1.7.3
c:\xampp\mysql_start.bat
c:\xampp\mysql_stop.bat
For check status i use c:\xampp\mysql\bin\mysqladmin -u root ping
I hope it will help you
They appear to have changed the my.cnf to my.ini within the MySQL/bin/my.ini part of the install, so I used:
Start: c:\xampp\mysql\bin\mysqld –defaults-file=c:\stuff\xampp\mysql\bin\my.ini –standalone –console
Stop: c:\xampp\mysql\bin\mysqladmin -u root –password= shutdown
Status: c:\xampp\mysql\bin\mysqladmin -u root –password= ping
Seems to work ok, had a little trouble getting the apache service to restart, but it did in the end
Nice guide. I believed they changed up the order of the dialogs when you setup, but it should be obvious to anyone following this guide. Also these are just minor things but I think they’re worth noting (for those who might have trouble):
my mysql config is c:\xampp\mysql\bin\my.ini (rather than .cnf)
Also if you’re running MySQL as a service then you’ll want to leave the defaults in the section labeled as commands to start/stop the mysql server (e.g. sc start mysql, sc stop mysql, sc query mysql | wba_filter(RUNNING)).
I’m using version 5.1.18 OSS and XAMPP.
Like papaman I can’t even find the “New Server Instance” option. There is nowere to be found. So I can’t connect to mysql instance.
This guide is for 5.2 – try that?
… and to be able to work with admin’s tools (Accounts, Data Dump, .. ) you need to check “Enable named pipes” in Configuration | General
to overcome command problems, you can install MySQL as a service (via XAMPP control Panel ) and leave commands as proposed by the wizard
Just to help clarify: the dashboard is in the 5.2 version. If you have the general release 5.1 version, there is not dashboard / “New Server Instance. Just download the development version and you’re good to go.
Thanks for the instructions.
Like everyone above, I found out the long way that you need the latest developer release and not the general release.
Regarding the ‘Commands to Manage MySQL Server’ I found that the above had some typo’s with the commands (probably Word auto formating) and a minor simplification:
Start: c:\xampp\mysql\bin\mysqld –defaults-file=c:\stuff\xampp\mysql\bin\my.cnf –standalone –console
Stop: c:\xampp\mysql\bin\mysqladmin -u root –password=apple shutdown
Status: c:\xampp\mysql\bin\mysqladmin -u root –password=apple ping
and no, apple is not my password
Hope this helps someone.
Thanks for this information, was very helpful.
I’m in the same boat as one of the other commenters–when I start Workbench, I see nothing like the “dashboard” you refer to in the first step, and no “new server instance” option. Instead I see a tab on the left called “MySQL Model”, and various smaller panes on the right, none of which look like the dashboard…
Are you running the latest version? The older version didn’t have such a dashboard.
Ah, that must be it–I used the msi installer under the “general release” section, which is a considerably older version than what they have for the “developer release”. I’ll give it another try later, thanks!
crony
my.cnf file
http://dev.mysql.com/doc/refman/4.1/en/mysql-cluster-multi-config.html
I installed MySQL Workbench 5.2 OSS here …
C:\xampp\mysql\MySQL Workbench 5.2 OSS
then created my 1st DB with phpmyadmin
My Win 7 MySql setup did use my.cnf
Here is the information it set up.
Manage Server Instances –>System Profile
Profile Template: Fedora Linux (MySql Package)
Path to configuration file: /etc/my.cnf
Section [name] from configuration file: mysqld
MySql Management
Start MySql: /etc/init.d/mysql start
Stop MySql: /etc/init.d/mysql stop
Check MySql Status: ps -C mysqld -o pid=
box checked —Use sudo to execute
I did find this odd … after doing a search of all files including hidden my search came up with NO file or directory of either name. [etc/my.cnf]
maybe it has to do with DRBD which I am not familiar with using, mounting or configuring.
http://dev.mysql.com/doc/refman/5.1/en/ha-drbd-install-mysql.html
After I set up a localhost and to test connections WB asks for a password and I don’t know how to get around that. Can you help?
Yes I do ^^
Xampp 1.6.3, perfectly running under eclipse environement…
I forgot to tell, I’m testing with 5.2.15 OSS Beta revision 5053…Maybe it needs the stable version ?
I also use MySql 5.0.45 community edition, I may choose between Mysql 5.0 x86 and x64 , Mysql 5.1 , and Mysql packages.
Of course, using Mysql 5.0 x86 in my case.
It sounds to me like you’re not running XAMPP? In which case, you just need to follow the wizard on your own terms.
Hello,
Thanks for this, but I get an error too…
Tested under winXP and Seven pro, same problem, server is not starting…
I think I’ve been realy carrefull with config, so must missingbe something…
Could it be possible to post the my.cnf properly formed ?( or sended by mail ? )
I suspect “enable-named-pipe” parameters, or a problem with quotes at the moment…
I would also like to see screenshots of an instance running. I’m particularly interested by the server status info (as the host is “Not Set” into mine…)
If possible, screens of “general” and “networking” would help me understanding better.
Thanks !
I am trying to set this up on XAMPP 1.7.3 and I am having an issue. This version of XAMPP seems to use a file called my.ini instead of my.cnf. I have the server instance created but when I try to start the server from the Startup area in Workbench it will not start. I have changed the start command to my.ini but it still will not work. The message I get is:
2010-01-27 21:56:29 – Checking server status: Server is stopped.
2010-01-27 21:56:29 – Trying to start server…
2010-01-27 21:56:29 –
2010-01-27 21:56:29 – Checking server status: Server is stopped.
Is there an updated/alternate start command that needs to be used for this?
See the step called Config File? Tells you all you need to know…
The whole point of a step by step guide is that you follow every step. If you do, all should be fine!
Yes it is buggy and sometimes unstable but it is usable.
Also, one friend told me to download package without installer to avoid some problems I may have with installation process…
The DB Designer Webpage download says that DB is now outdated and they suggest using Workbench – 5.2.14 is latest — so I guess that is the way to go …. thanks for the write up …looks very useful for my XAMPP arsenal
can´t start serverinstance
(winxp, mysql running, workbench-installation ok)
Input Password (dialog)
`Enter Password to connect to MYSQL Server at as “.`
strange?
walther
This works great using the workbench for OS X 10.6, 5.2.x. Useful setup info is hard to find from MySQL, so great job! Thanks.
Unstable?
Maybe I’ve been lucky but I’ve been using ‘workbench’ on XP, Vista and now Win7 for 2 years or more with very few problems.
It does slow down a lot when working with many tables and admittedly I’ve only used the ‘designer’ and ‘sql export’ parts of the application to any extent, but I’ve been more than happy with the stability.
I applied this to my WAMP installation, and it works like a charm. Thank you!
I can’t even find the “New Server Instance” option
It’s right there on the dashboard, to the right. Unless you have a tab already open, in which case, switch tabs or close them!
I currently use DB Designer as well, and although it’s a great piece of software, I’m intrigued by Workbenches options and functionality. I see that someone has already mentioned how unstable it is (and I realize it’s still in beta) but I was wondering how well it truly works? how reliable is it? (I don’t save often and crashes kill my workflow )
Unfortunately I’m not using it in anger just yet, so can’t really comment on its long term stability. Sorry.
I am surprised to see that you are able to use Workbench for a “real” project. It is so buggy and unstable. You are lucky!
I love DBDesigner and still use it.
Have to say, I’ve seen slicker! Apparently it works much better in a *nix system, so I’ll try it out on my Debian VM at some point.
Of course, that won’t be XAMPP then