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

一,前言html

  記一次安裝解壓版的mysql 5.5的通過,參考了一些文章,也遇到了一些錯誤,最終都安裝成功了。在這裏記錄一下安裝的過程,一方面本身作一個記錄,領一方面給你們提供一份參考。mysql

二,環境sql

  1,windows 10 64位數據庫

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

三,安裝步驟工具

  1,解壓測試

    將mysql-5.5.62-winx64.zip解壓到本身的盤符spa

  2,配置ini文件.net

    複製一份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

五,結束

  但願對你們有所幫助

相關文章
相關標籤/搜索