Mysql下载与安装 (出错install/remove of the service denied)

来源:互联网 发布:丰城市网络问政 编辑:程序博客网 时间:2024/06/05 23:51

1.在mysql官网下载社区版的mysql :
http://dev.mysql.com/downloads/mysql/

2.解压版本,下载后只需要解压到指定目录,如D:\program files\mysql。

3.安装服务
去cmd命令窗口,进入mysql\bin目录,输入命令安装:mysqld –install
具体操作如下:
这里写图片描述
但是出错了:install/remove of the service denied

出错原因:权限不够
解决方法:重新打开cmd.exe,然后右键,用管理员身份打开。

这里写图片描述

再次输入命令mysqld –install ,就提示Service successfully installed.

4.开启服务 输入:net start mysql
如下是在cmd环境下输入命令后的显示:
D:\program files\mysql\bin>net start mysql
MySQL 服务正在启动..
MySQL 服务已经启动成功。

5.直接登录mysql , 输入: mysql -uroot (登录本机下的root账号,没有密码)
mysql在windows下默认没有密码,在linux下默认有密码。 如下是cmd环境下的显示:
D:\program files\mysql\bin>mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.31 MySQL Community Server (GPL)
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement.
mysql>

6.退出数据库服务器登录
mysql>\q
mysql>quit
mysql>exit

7.卸载mysql服务
进入mysql\bin下,先停止服务,然后移除:
D:\program files\mysql\bin>net stop mysql 停止正在运行的服务
D:\program files\mysql\bin>mysqld –remove 移除mysql的安装服务
为了卸载干净,建议手动把D:\program files\mysql文件包删除。
这里写图片描述

0 0
原创粉丝点击