当前位置:网站首页>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
边栏推荐
猜你喜欢
SOC_SD_DATA_FSM
SD_CMD_SEND_SHIFT_REGISTER
Orin two brushing methods
Orin installs CUDA environment
Logical structure and physical structure
Sre core system understanding
Speedtree01 generator properties
ROS2——Service服务(九)
Pycahrm reports an error: indentation error: unindent does not match any outer indentation
Ros2 - ros2 vs. ros1 (II)
随机推荐
ROS2——ROS2对比ROS1(二)
mingling
Ret2xx---- common CTF template proposition in PWN
Record of problems in ollvm compilation
Xiaomi written test real question 1
Adg5412fbruz-rl7 applies dual power analog switch and multiplexer IC
[nvidia] CUDA_ VISIBLE_ DEVICES
【软件测试】02 -- 软件缺陷管理
解读最早的草图-图像翻译工作SketchyGAN
SOC_SD_CMD_FSM
Ros2 - first acquaintance with ros2 (I)
7. Oracle table structure
Mutual transformation between two-dimensional array and sparse array (sparse matrix)
[MySQL 8.0 does not support capitalization of table names - corresponding scheme]
Mid 2022 documentary -- the experience of an ordinary person
扫盲-以太网MII接口类型大全-MII、RMII、SMII、GMII、RGMII、SGMII、XGMII、XAUI、RXAUI
kata container
二分查找(折半查找)
Positive height system
ROS2——node节点(七)