下載並安裝mysql,用Navicat遠程訪問

⭐個人網站: www.mengyingjie.com⭐ mysql

下載並安裝mysqlsql

(1)在服務器上打開Mysql端口號:3306

image.png

(2)用Xshell鏈接服務器(在Windows上下載安裝及使用xshell)

(3)下載和安裝mysql

第一步:安裝從網上下載文件的wget命令shell

yum -y install wget
複製代碼

第二步:下載mysql的repo源bash

wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm
複製代碼

第三步:安裝mysql-community-release-el7-5.noarch.rpm包服務器

rpm -ivh mysql-community-release-el7-5.noarch.rpm
複製代碼

第四步:查看下post

ls -1 /etc/yum.repos.d/mysql-community*
/etc/yum.repos.d/mysql-community.repo
/etc/yum.repos.d/mysql-community-source.repo

複製代碼

會得到兩個mysql的yum repo源:/etc/yum.repos.d/mysql-community.repo,/etc/yum.repos.d/mysql-community-source.repo網站

第五步:安裝mysqlspa

yum install mysql-server
複製代碼

(4)啓動Mysql服務

service mysql start
複製代碼

(5)鏈接mysql

image.png

(6)建立用戶

GRANT ALL PRIVILEGES ON *.* TO 'username'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION;
複製代碼

username:爲用戶名 %:表示全部外網IP均可以鏈接 password:是你本身設置的密碼 -- 刷新權限表code

flush privileges;
複製代碼

(7)記得打開服務器的防火牆

啓動防火牆cdn

systemctl start firewalld.service
複製代碼

(8)在本地電腦用Navicat鏈接

第一種方法

image.png

image.png

第二種方法

image.png

遇到此類問題,但看了文章仍是未解決, 評論或加 QQ:781378815

相關文章
相關標籤/搜索