有两种方式:
1. 以本地服务方式启动
安装mysql本地服务
c:\mysql5.1\bin\mysqld.exe --install [服务名]
如果不写"服务名",默认MySql。
如要增加设置文件,格式如下:
c:\mysql5.1\bin\mysqld.exe --install --defaults-file=
例如:
c:\mysql5.1\bin\mysqld.exe --install mysql --defaults-file=C:/mysql5.1/my.ini
启动mysql
net start
如:net start MySql
如果要删除mysql本地服务
net stop
c:\mysql5.1\bin\mysqld.exe --remove [服务名]
服务名默认MySql
2. 直接以console方式启动
C:\mysql5.1\bin\mysqld.exe --defaults-file=C:/mysql5.1/my-small.ini --console
参数--console , 运行时信息输出屏幕,且不用关闭console窗口。
如果要停止mysqlServer运行 C:\mysql5.1\bin\mysqladmin.exe shutdown --user=root --password