当前位置:网站首页>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
边栏推荐
- npm install -g/--save/--save-dev的区别
- Rehabilitation type force deduction brush question notes D1
- 摄像头的MIPI接口、DVP接口和CSI接口
- [Chongqing Guangdong education] National Open University 2018 autumn 0702-22t contemporary Chinese political system reference questions
- [nvidia] CUDA_ VISIBLE_ DEVICES
- Markdown syntax
- 代码中的英语全部
- Some classic recursion problems
- Pycahrm reports an error: indentation error: unindent does not match any outer indentation
- All English in the code
猜你喜欢

SOC_SD_DATA_FSM

Marvell 88e1515 PHY loopback mode test

SD_CMD_SEND_SHIFT_REGISTER

Instruction execution time

Some classic recursion problems

Use the Paping tool to detect TCP port connectivity

1290_FreeRTOS中prvTaskIsTaskSuspended()接口实现分析

SD_CMD_RECEIVE_SHIFT_REGISTER

The problem of Chinese garbled code in the vscode output box can be solved once for life

7. Oracle table structure
随机推荐
Cookie、Session、JWT、token四者间的区别与联系
Special training of C language array
The “mode“ argument must be integer. Received an instance of Object
Build a microservice cluster environment locally and learn to deploy automatically
Orin 两种刷机方式
ROS2——ROS2对比ROS1(二)
Speedtree01 generator properties
SD_CMD_SEND_SHIFT_REGISTER
new和malloc的区别
数据库Mysql全部
Redis-01. First meet redis
SOC_SD_CMD_FSM
2022年中纪实 -- 一个普通人的经历
Get class files and attributes by reflection
Cloud native related technology learning
The differences and connections among cookies, sessions, JWT, and tokens
ROS2——工作空间(五)
U-Boot初始化及工作流程分析
Record of problems in ollvm compilation
睿智的目标检测59——Pytorch Focal loss详解与在YoloV4当中的实现