当前位置:网站首页>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
边栏推荐
- Use the Paping tool to detect TCP port connectivity
- 【软件测试】05 -- 软件测试的原则
- Special training of C language array
- 睿智的目标检测59——Pytorch Focal loss详解与在YoloV4当中的实现
- Error: “MountVolume.SetUp failed for volume pvc 故障处理
- testing framework
- MySQL (UDF authorization)
- 逻辑结构与物理结构
- Preemption of CFS scheduling
- Ros2 - function package (VI)
猜你喜欢
随机推荐
网易To B,柔外刚中
程序中的负数存储及类型转换
Pycahrm reports an error: indentation error: unindent does not match any outer indentation
Use the Paping tool to detect TCP port connectivity
Lexin interview process
SolidWorks template and design library are convenient for designers to call
Logical structure and physical structure
[nvidia] CUDA_ VISIBLE_ DEVICES
. Net core stepping on the pit practice
Unity 之 ExecuteAlways正在取代ExecuteInEditMode
在本地搭建一个微服务集群环境,学习自动化部署
Page type
2. Addition and management of Oracle data files
Xavier CPU & GPU 高负载功耗测试
ROS2——node节点(七)
Interpretation of the earliest sketches - image translation work sketchygan
解读最早的草图-图像翻译工作SketchyGAN
并发编程 — 死锁排查及处理
postmessage通信
二分查找(折半查找)









