mysql5.5.x.zip 解壓版安裝教程


一,前言

  記一次安裝解壓版的mysql 5.5的經過,參考了一些文章,也遇到了一些錯誤,最終都安裝成功了。在這里記錄一下安裝的過程,一方面自己做一個記錄,領一方面給大家提供一份參考。

二,環境

  1,windows 10 64位

  2,mysql-5.5.62-winx64。從mysql官網上下載的。

三,安裝步驟

  1,解壓

    將mysql-5.5.62-winx64.zip解壓到自己的盤符

  2,配置ini文件

    復制一份my-small.ini,重命名為:my.ini

    在my.ini中添加以下內容:

[client]
# 以寬松模式設置字符集,一定要注意 loose
-default-character-set = utf8

[mysqld]
# 以寬松模式設置字符集,一定要注意
loose-default-character-set = utf8
# 解壓路徑
basedir = D:/software/mysql-5.5.62-winx64
datadir = D:/software/mysql-5.5.62-winx64/data

[WinMySQLadmin]
Server = D:/software/mysql-5.5.62-winx64/bin/mysqld.exe

  3,配置環境變量

    新建一個環境變量,變量名為:MYSQL_HOME,變量值為你的mysql根目錄,如:D:/software/mysql-5.5.62-winx64
    然后在系統變量Path中添加:%MYSQL_HOME%\bin

  4,安裝mysql服務

    以管理員模式打開命令行(cmd),切換到mysql的解壓(%MYSQL_HOME%\bin)目錄,執行命令:mysqld -install

    成功提示:

D:\software\mysql-5.5.62-winx64\bin>mysqld -install
Service successfully installed.

   5,啟動mysql服務

    在命令行工具(cmd)中執行命令:net start mysql

    啟動成功提示:

D:\software\mysql-5.5.62-winx64\bin>net start mysql
MySQL 服務正在啟動 ..
MySQL 服務已經啟動成功。

   6,修改root密碼

    在命令行工具(cmd)中執行命令:mysql -u root,進入數據庫

    然后執行sql語句更改root密碼:

    update mysql.user set password = PASSWORD('root') where User = 'root';

    flush privileges;

D:\software\mysql-5.5.62-winx64\bin>mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.5.62 MySQL Community Server (GPL)

Copyright (c) 2000, 2018, 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> update mysql.user set password = PASSWORD('root') where User = 'root'
    -> ;
Query OK, 3 rows affected (0.12 sec)
Rows matched: 3  Changed: 3  Warnings: 0

mysql> flush privileges;
Query OK, 0 rows affected (0.02 sec)

     7,測試

      使用navaicat,使用root用戶連接mysql數據庫,測試接成功。

    

    到這里,我們的mysql數據庫已經安裝成功了,但是在這個過程中,我遇到了兩個問題,下面說明一下

四,遇到的問題

  1,進行第四步安裝msql服務時,提示:mysql Install/Remove of the Service Denied!

   使用管理員模式打開cmd,執行安裝命令即可。參考鏈接:https://blog.csdn.net/lxpbs8851/article/details/14161935

  2,啟動Msql服務時提示:發生系統錯誤 1067。

    打開windows的事件查看器發現.  

    

     原來是我設置的字符集的問題,在my.ini中,字符集設置default-character-set前,添加loose-即可,參考鏈接:https://www.cnblogs.com/kerrycode/p/4859659.html

五,結束

  希望對大家有所幫助

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM