本文目錄一覽:
mysql資料庫怎麼安裝
從MSQL官網下載MySQL伺服器安裝軟體包,下面以mysql-installer-community-5.7.3.0-m13.msi為例。
1、雙擊進入安裝
2、在協議許可(License Agreement)界面,勾選「I accept the license terms」,點擊「Next」。
3、在檢查更新信息(Find latest products)界面,勾選「Skip the check for updates(no recommended)」跳過檢查,然後點擊「Next」。
4、在選擇安裝類型(Choosing a Setup Type)界面,根據安裝需求選擇安裝類型(推薦默認開發版本),設置MySQL安裝路徑和數據存放路徑,最後點擊「Next」。
5、在檢查要求(Check Requirements)界面,點擊「Next」。
6、安裝進度(Installation progress)界面,點擊「Execute」執行。
7、等待安裝進度完畢,點擊「Next」。
8、進入配置概述(Configuration Overview)界面,點擊「Next」。
9、在MySQL服務配置(MySQL Server Configuration)界面,默認不做修改,點擊「Next」。
10、設置根賬戶(root賬戶)密碼。
11、添加(非根)用戶賬戶。其目的是便於資料庫許可權管理,為遠程訪問者提供安全賬戶。
12、默認windows服務配置不做修改,點擊「Next」。
13、回到配置概述(Configuration Overview)界面,安裝完畢點擊「Next」。
14、MySQL安裝完成(Installation Complete),點擊「Finish」。
15、若勾選「安裝後啟動Mysql工作台」(Start Mysql Workbench after Setup),可見如下界面。
注意:MySQL環境變數配置。
在windows命令提示符中輸入mysql,提示「mysql」不是內部或外部命令。只需將MySQL安裝路徑添加系統環境變數即可。
如安裝路徑為「D:\Program Files\MySQL」目錄,則進入mysql server的bin目錄下複製路徑;其次在環境變數中編輯變數Path,變數值中輸入「;」後粘貼「D:\Program Files\MySQL\MySQL Server 5.7\bin」路徑,最後從新打開命令提示符窗口運行mysql即可。
如何安裝mysql資料庫
1、MySQL下載後的文件名為:mysql_installer_community_V5.6.21.1_setup.1418020972.msi
2、雙擊後,彈出如下窗口
3、安裝開始界面
4、勾選 I accept the license terms
5、選擇下一步,選項如下:全部安裝包括開發環境,只安裝sever,只安裝客戶端,全部安裝但是不包括開發環境,自定義。
如何安裝MYSQL
使用yum安裝mysql資料庫的軟體包 [root@xuegod63 ~]# yum -y install mariadb-server mariadb 。
註: mariadb-server #MariaDB資料庫 mariadb # MariaDB伺服器Linux下客戶端 。
註:從centos7系統開始,系統中自帶的mysql資料庫變成了mariadb-server,mariadb-server和mysql操作上一樣。mariadb-server是mysql的一個分支。
啟動資料庫服務[root@xuegod63 ~]# systemctl start mariadb #啟動MariaDB服務。[root@xuegod63 ~]# systemctl enable mariadb #設置開啟自動啟動MariaDB服務。
安裝完mariadb-server後,運行mysql_secure_installation去除安全隱患,[root@xuegod63 ~]# mysql_secure_installation #進入安全配置導向。
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQLSERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we’ll need the current,password for the root user. If you’ve just installed MySQL, and,you haven’t set the root password yet, the password will be blank,,so you should just press enter here.Enter current password for root (enter for none): #初次運行直接回車,因為root用戶沒有密碼。
OK, successfully used password, moving on,Setting the root password ensures that nobody can log into the MySQL,root user without the proper authorisation.,Set root password? [Y/n] Y #是否設置root用戶密碼,輸入Y。
New password: 123456 #新密碼123456,Re-enter new password: 123456,Password updated successfully!Remove anonymous users? [Y/n] Y #是否刪除匿名用戶,生產環境建議刪除,所以直接回車或Y。
Success!Normally, root should only be allowed to connect from ‘localhost’. Thisensures that someone cannot guess at the root password from the network.Disallow root login remotely? [Y/n] Y #是否禁止root遠程登錄,根據自己的需求選擇Y/n並回車建議禁止。
Success!By default, MariaDB comes with a database named ‘test’ that anyone canaccess. This is also intended only for testing, and should be removedbefore moving into a production environment.Remove test database and access to it? [Y/n] Y #是否刪除test資料庫,直接回車或Y。
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-tw/n/198649.html