安装
一、Choose Setup Type–
typical(默认)
custom(用户自定义安装)–
修改路径:MySQL Server(F:MySQL)和Server Data Files(F:\data\MySQL)
documentation–
will be installed ….
compete(完全安装)
二、MySQL Server Install Configuration–
detailed configuration(精细配置)–
Developer Machine(开发者电脑)–
Multifunctional Database(多用途数据库)–
Decision Support (并发连接数上限20)
Online Transaction Processing(并发连接数上限500)
Manual Setting(自己选择连接数上限)–
Standard Character Set
Best Support For Multilingualism
Manual Selected Default Character Set–utf8
Transaction Database Only(事务数据库)
Non-Transaction Database Only(非事务数据库)
Server Machine(服务器电脑,内存使用大)
Dedicated MySQL Server Machine(MySQL服务器电脑,内存全部给MySQL使用)
standard configuration(标准配置)
启动MySQL
运行:–services.msc
cmd管理员模式下:启动–net start mysql
关闭–net stop mysql
MySQL 的登录
MySQL是一个需要账户名密码登录的数据库,登陆后使用,它提供了一个默认的root账号,使用安装时设置的密码即可登录。
格式1:cmd> mysql –u用户名 –p密码
例如:mysql -uroot –proot
格式2:cmd> mysql –host=ip地址 –user=用户名 –password=密码
例如:mysql –host=127.0.0.1 –user=root –password=root
密码重置
方法一:
在my.ini的[mysqld]字段加入:
skip-grant-tables
重启mysql服务,这时的mysql不需要密码即可登录数据库
然后进入mysql
mysql>use mysql;
mysql>更新 user set password=password(‘新密码‘) WHERE User=‘root‘;
mysql>flush privileges;
运行之后最后去掉my.ini中的skip-grant-tables,重启mysqld即可。
方法二:
不使用修改my.ini重启服务的方法,通过非服务方式加skip-grant-tables运行mysql来修改mysql密码
停止mysql服务
打开命令行窗口,在bin目录下使用mysqld.exe启动,即在命令行窗口执行: mysqld –skip-grant-tables
然后另外打开一个命令行窗口,登录mysql,此时无需输入mysql密码即可进入。
按以上方法修改好密码后,关闭命令行运行mysql的那个窗口,此时即关闭了mysql,如果发现mysql仍在运行的话可以结束掉对应进程来关闭。
启动mysql服务
卸载
停止MySQL服务
1添加删除程序中卸载MySQL
2到安装目录删除MySQL
3删除:C:\Documents and Settings\All Users\Application Data\MySQL
C:\ProgramData\MySQL
4查看注册表:
regedit
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet002\Services
找到mysql,一律干掉!