mySQL安装教程及常见问题

一、下载安装

1、压缩版安装

链接:压缩版MySql下载和安装指南

2、Windows Installer

(1)for XP

链接:安装包下载mysql-5.5.40-win32.msi for xp

链接:mysql-5.5.20-win32 安装方法

二、常见问题

1、DOS下以管理员身份运行cmd

在DOS窗口中输入命令“ runas /user:administrator "cmd /k"  ”

然后输入密码即可

2、mysqld.exe不是有效的win32文件

原因:版本不支持:xp上不能装5.0以上的版本

版本支持情况:链接:Supported Platforms: MySQL Database

3、系统出错, 发生系统错误 1067, 进程意外终止. 

一般原因是系统没有找到配置为文件,在当前目录下,添加my.ini

在文件里面添加

[mysqld] 
basedir=D:\Program\Tools\mysql 
datadir=D:\Program\Tools\mysql\data

链接:系统出错, 发生系统错误 1067, 进程意外终止. 解决方法

4、the service already exists

在当前安装目录下使用mysqld -remove MySQL移除后再执行mysqld -install即可

链接:The vervice already exists!-mysql安装服务

5、a windows service with the name MYSQL already...service

可以尝试删除残留的注册表信息HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services下面找到MySQL注册表信息把它整个删掉后,重装mysql!

6、cannot create windows service

(1)在桌面上找到“MyComputer“,右键选择“Manage”,然后选择”Service and Applications“,然后选择”services“,找到”MySQL“服务,右键停止

(2)在dos窗口,使用如下命令:

  sc delete mysql

7、windows:mysql不是内部或外部命令

链接:解决mysql不是外部或内部命令

添加环境变量(变量名为PATH,变量值为安装目录下bin的目录)

我的电脑->属性->高级->环境变量->用户变量->添加

8、 Access denied for user ‘root’@’localhost’(windows)

链接:mysql Access denied for user root@localhost错误解决方法总结

(1)编辑mysql配置文件my.ini(在mysql的安装目录下),在[mysqld]这个条目下加入 skip-grant-tables 保存退出

(2)运行DOS命令行:cmd

(3)停止mysql:输入 net stop mysql

(4)重新启动mysql:输入 net start mysql  

(5)进入mysql:这时候在cmd里面输入mysql -u root -p就可以不用密码登录了,出现 password:的时候直接回车可以进入

(6)进入mysql数据库:

mysql> use mysql; 

Database changed

(7)给root用户设置新密码:  

mysql> update user set password=password("新密码") where user="root"; 

Query OK, 1 rows affected (0.01 sec) 

Rows matched: 1 Changed: 1 Warnings: 0

(8)刷新数据库

mysql> flush privileges;

Query OK, 0 rows affected (0.00 sec)  

(9)退出mysql:

mysql> quit; 

Bye

(10)再修改一下my.ini这个文件,把我们刚才加入的 "skip-grant-tables"这行删除

(11)停止mysql:输入 net stop mysql

(12)重新启动mysql:输入 net start mysql  



猜你喜欢

转载自blog.csdn.net/zxx910509/article/details/68941130