時間:2022-06-09來源:www.www.newsthatmovesu.com作者:電腦系統城
win11安裝mysql8最新壓縮包版,供大家參考,具體內容如下
1、下載mysql
2、解壓
3、初始化數據庫并安裝啟動服務
以管理員身份打開CMD命令控制臺
cd c:/dbs/mysql-8.0.29/bin 進入mysql8.0.29目錄
mysqld --initialize-insecure 初始化,會自動的在c:/dbs/mysql-8.0.29/data 建立目錄
mysqld install 安裝服務,服務名稱為mysql
net start mysql 開啟數據庫服務
net stop mysql 關閉數據庫服務
mysqld remove 卸載服務
如果要通過窗口查看服務,在運行中可以輸入services.msc 打開服務窗口
4、登錄服務器測試
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
C:\Users\webrx>cd \ C:\>cd dbs\mysql-8.0.29 C:\dbs\mysql-8.0.29>cd bin #登錄本機 -hlocalhost -uroot -p空沒有密碼 -P3306 可以不寫 C:\dbs\mysql-8.0.29\bin>mysql -uroot Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.29 MySQL Community Server - GPL Copyright (c) 2000, 2022, Oracle and / or its affiliates. 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> select @@hostname,@@port,@@version,@@basedir,@@datadir,now(); + ------------+--------+-----------+----------------------+---------------------------+---------------------+ | @@hostname | @@port | @@version | @@basedir | @@datadir | now() | + ------------+--------+-----------+----------------------+---------------------------+---------------------+ | wp | 3306 | 8.0.29 | C:\dbs\mysql-8.0.29\ | C:\dbs\mysql-8.0.29\data\ | 2022-05-11 14:25:17 | + ------------+--------+-----------+----------------------+---------------------------+---------------------+ 1 row in set (0.00 sec) mysql> show databases; + --------------------+ | Database | + --------------------+ | information_schema | | mysql | | performance_schema | | sys | + --------------------+ 4 rows in set (0.02 sec) mysql> select host, user ,plugin from mysql. user ; + -----------+------------------+-----------------------+ | host | user | plugin | + -----------+------------------+-----------------------+ | localhost | mysql.infoschema | caching_sha2_password | | localhost | mysql.session | caching_sha2_password | | localhost | mysql.sys | caching_sha2_password | | localhost | root | caching_sha2_password | + -----------+------------------+-----------------------+ 4 rows in set (0.00 sec) mysql> create user admin identified with mysql_native_password by 'admin' ; Query OK, 0 rows affected (0.01 sec) mysql> grant all on *.* to admin; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges ; Query OK, 0 rows affected (0.00 sec) mysql> select host, user ,plugin from mysql. user ; + -----------+------------------+-----------------------+ | host | user | plugin | + -----------+------------------+-----------------------+ | % | admin | mysql_native_password | | localhost | mysql.infoschema | caching_sha2_password | | localhost | mysql.session | caching_sha2_password | | localhost | mysql.sys | caching_sha2_password | | localhost | root | caching_sha2_password | + -----------+------------------+-----------------------+ 5 rows in set (0.00 sec) |
5、使用sqlyog 連接mysql8.0.29
注意:低版本的sqlyog(13.1.1及以下)無法識別mysql新版本(5.7-8)的加密機制(caching_sha2_password)
必須使用admin用戶(在步驟4中建立的使用舊加密機制(mysql_native_password)的用戶)登錄
以上就是本文的全部內容,希望對大家的學習有所幫助。
2022-06-20
MySQL數據庫實驗實現簡單數據庫應用系統設計2022-06-09
MySQL 8.0.29 安裝配置方法圖文教程(windows zip版)2022-06-09
MySQL Community Server 8.0.29安裝配置方法圖文教程