windows 系统
下载mysql的zip版, 然后解压.
进入bin路径下, 用命令
mysqld --install
安装mysql服务.
配置mysql.ini 启动服务即可.
查看日志: basedir/data/{username}.err
Linux 系统
shell> groupadd mysql
shell> useradd -r -g mysql mysql
shell> cd /usr/local
shell> tar zxvf /path/to/mysql-VERSION-OS.tar.gz
shell> ln -s full-path-to-mysql-VERSION-OS mysql
shell> cd mysql
shell> chown -R mysql .
shell> chgrp -R mysql .
shell> scripts/mysql_install_db --user=mysql
shell> chown -R root .
shell> chown -R mysql data
shell> bin/mysqld_safe --user=mysql &
# Next command is optional 这一步是注册系统服务
shell> cp support-files/mysql.server /etc/init.d/mysql
shell> service mysql start
配置文件在安装路径中 my.cnf
如果安装路径不是 /usr/local, 那么在注册系统服务前需要修改mysql.server中的 basedir 和 datadir
修改了这两个路径后再将文件 mysql.server 复制到 /etc/init.d/ 下面, 然后就可以启动mysql服务了.