当前位置:网站首页>Steps and FAQs of connecting windows Navicat to Alibaba cloud server MySQL
Steps and FAQs of connecting windows Navicat to Alibaba cloud server MySQL
2022-07-05 06:59:00 【Silence, your name】
Log in to your Alibaba cloud server first
There are two more important , One is to configure the exit port ,
Another is to get your own public network ip Connect to the server
I use it finalshell Tool connection .
Mainly based on docker install mysql , Now my server docker Already installed , It's easy to install . There are many detailed steps on the Internet , Just run it once
I also wrote an article myself . But it doesn't matter , It is important to pay attention to several points after installation
Look at the mirror image
docker images
But it doesn't matter whether you look or not , It will be pulled automatically anyway
Look at the container
docker ps
Follow the command and run again , Then check it out mysql Successful operation . If mysql Successfully run . Use navicat Connect
Okay , Half the water . navicat There are several common errors in connection
2005 - Unknown MySQL server host '45.130.63.101' (11001) "
This error should be reported by the server ip incorrect
2003 - Can't connect to MySQL server on '47.100.68.107' (10060 "Unknown error")
Maybe the port is not open
Remember to open the server port . This port is not necessarily 3306 . It's up to you to start docker Container time . Mapped port
But half of them are 3306
1045 - Access denied for user 'root'@'117.147.47.90' (using password: YES).
After the port is opened , Change a wrong one .ip I'm too lazy to hide . This port is more general . Maybe the account and password are wrong . It may also be that the account does not allow remote access .
# to update , Or install yum
yum -y update
# Clear the remaining items of the system if the server has not been installed before Docker, You can skip
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
# Installation package required
yum install -y yum-utils
# Set up the warehouse for the image
yum-config-manager \
--add-repo \
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
# to update yum Package index
yum makecache fast
# install docker dependent docker-ce Community Edition and ee It's the enterprise edition
yum install docker-ce docker-ce-cli containerd.io
start-up docker
systemctl start docker
# test
docker run hello-world
12345678910111213141516171819202122232425262728293031323334353637
#8. View the downloaded images ( From here, you can view the existing images id)
[[email protected] ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
hello-world latest bf756fb1ae65 4 months ago 13.3kB
# Create and enter relevant containers
mkdir ~/mysql
cd ~/mysql
# Configure Alibaba cloud image acceleration
http://oss.console.aliyun.com
Console search container image service . Image accelerator , Choose your own linux Version USES . Everyone's different
# docker Download mysql
docker pull mysql
# start-up
docker run -id \
-p 3306:3306 \
--name=mysql \
-v $PWD/conf:/etc/mysql/conf.d \
-v $PWD/logs:/logs \
-v $PWD/data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=a123..a \
-d mysql
# Into the container
docker exec -it mysql bash
# Sign in mysql
mysql -u root -p
# modify root User password
ALTER USER 'root'@'localhost' IDENTIFIED BY 'a123..a';
# Add remote login user ------- 8.0 After that ----------------
#user_name: To create a user's name
#host: Indicates which machine the newly created user is allowed to log in from , If you are only allowed to log in from this machine , be fill ‘localhost’ , If remote login is allowed , Then fill in ‘%’
#password: Login database password of newly created user , If you don't have a password, don't write .
CREATE USER 'silence'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
#privileges: Say what power to grant , For example, there can be select , insert ,delete,update etc. , If all power is to be granted , Then fill in ALL
#databasename.tablename: Indicates which table in which database the user's permission can be used , If you want the user's permissions to work on all tables in all databases , Then fill in *.*,* It's a wildcard , All
#’username‘@‘host’: Indicates which user is authorized .
GRANT ALL PRIVILEGES ON *.* TO 'silence'@'%';
# Add remote login user ------- 8.0 Previous
# first root Represents the user name ,% All computers can be connected , You can also set a ip Address run connection , the second root The password
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION;
# Refresh MySQL System authority related table of
flush privileges;
# View all users ( user name 、 Who is authorized to )
SELECT user,host FROM mysql.user;
docker exec mysql01 bash
Enter the container first . Remember to change the name of your container . Specified when creating containers
Sign in mysql
Welcome to the MySQL monitor. See this to prove the account password , That's all right. . If navicat I logged in with this account and password , Still there 1045 . That is the problem of account authorization .
# Add remote login user ------- 8.0 Previous # first root Represents the user name ,% All computers can be connected , You can also set a ip Address run connection , the second root The password GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'root' WITH GRANT OPTION; # Refresh MySQL System authority related table of flush privileges; # View all users ( user name 、 Who is authorized to ) SELECT user,host FROM mysql.user;
I used to give root Account authorized , But it still seems 1045 . no way
SELECT user,host FROM mysql.user;
It may be the reason why I didn't do well . Later, I created another user silence . Can successfully access .
Let me create another account .
A lot of things , In fact, it is to create users , Authorize remote access . My username here is silence1
CREATE USER 'silence1'@'%' IDENTIFIED WITH mysql_native_password BY '123456';
GRANT ALL PRIVILEGES ON *.* TO 'silence1'@'%';
Okay . Connected
边栏推荐
- Spinningup drawing curve
- ROS2——功能包(六)
- C语言数组专题训练
- SOC_SD_DATA_FSM
- Marvell 88e1515 PHY loopback mode test
- All English in the code
- [Chongqing Guangdong education] 1185t administrative leadership reference test of National Open University in autumn 2018
- Integer to 8-bit binary explanation (including positive and negative numbers) scope of application -127~+127
- PR automatically moves forward after deleting clips
- mysql设置触发器问题
猜你喜欢
Positive height system
Build a microservice cluster environment locally and learn to deploy automatically
LSA Type Explanation - lsa-1 [type 1 LSA - router LSA] detailed explanation
Marvell 88e1515 PHY loopback mode test
What is linting
SOC_SD_DATA_FSM
Some classic recursion problems
SRE核心体系了解
Utf8 encoding
Page type
随机推荐
Vant Weapp SwipeCell設置多個按鈕
Page type
Ros2 - function package (VI)
【软件测试】04 -- 软件测试与软件开发
mysql设置触发器问题
Orin 安装CUDA环境
Use ffmpeg to rotate, flip up and down, and flip horizontally
LSA Type Explanation - detailed explanation of lsa-2 (type II LSA network LSA) and lsa-3 (type III LSA network Summary LSA)
在本地搭建一个微服务集群环境,学习自动化部署
mingling
Volcano 资源预留特性
Preemption of CFS scheduling
postmessage通信
网易To B,柔外刚中
Written examination notes
. Net core stepping on the pit practice
并发编程 — 如何中断/停止一个运行中的线程?
睿智的目标检测59——Pytorch Focal loss详解与在YoloV4当中的实现
Skywalking all
Logical structure and physical structure