When using the bird cloud server to build a website , Because of the installation mysql There are some problems in the process of teaching , So I'm going to write it down , The first one is about installation mysql after , But can't be accessed from the outside , And how to solve it , In addition to searching for relevant information by yourself , You can also consult the corresponding technicians , The response soon , The problem can also be solved .
Return to the right topic .
mysql Only local connections are allowed by default , in other words , After installation mysql There will be two after root Account , their host Namely localhost and 127.0.0.1, If your website and database are on the same server , So it's accessible . But if your website and database are not on different servers , Then the website won't be able to use remote databases ( The database server denied access to ).
1. Change table
Sign in phpmyadmin, Put the user's host Modified into %, Restart the server .
use mysql;
update user set host='%' where user='root'
flush privileges;
2. to grant authorization
Such as : Allow account myuser Use password 1234 Connect from any host to mysql Server , Then in mySQL Type... On the command line :
GRANT ALL PRIVILEGES ON . TO 'myuser'@'%' IDENTIFIED BY '1234' WITH GRANT OPTION;
here % To allow all IP Address access . It can be changed to specific IP, such as :
Allow account myuser from ip by 192.168.1.3 Of hosts connected to mysql The server , And use 12345 As password , Then in mySQL Type... On the command line :
GRANT ALL PRIVILEGES ON . TO 'myuser'@'192.168.1.3' IDENTIFIED BY '12345' WITH GRANT OPTION
Last , Make Settings work
mysql>FLUSH PRIVILEGES
Refer to this document for specific settings :https://www.niaoyun.com/docs/...
当前位置:网站首页>Reasons why MySQL cannot be connected externally after installing MySQL database on ECs and Solutions
Reasons why MySQL cannot be connected externally after installing MySQL database on ECs and Solutions
2022-06-25 22:29:00 【Want none】
边栏推荐
- Data annotation in the second half: growth flywheel under PLG mode Manfu Technology
- [动态规划]最长回文子串-对于动态转移循环顺序的思考
- JS limit mouse movement range
- Win11 start menu right click blank? The right button of win11 start menu does not respond. Solution
- Zhihu Gaozan: what ability is important, but most people don't have it?
- Zero Trust: break the passive development mode of "attack and defense" and build a "moat" for enterprise safety
- mysql 通过sql 修改多表增加多个字段
- MySQL Chapter 15 lock
- Leetcode topic [array] -18- sum of four numbers
- Research and Analysis on the current situation of Chinese acne drug market and forecast report on its development prospect (2022)
猜你喜欢

Top in the whole network, it is no exaggeration to say that this Stanford machine learning tutorial in Chinese notes can help you learn from the beginning to the mastery of machine learning

Zero Trust: break the passive development mode of "attack and defense" and build a "moat" for enterprise safety

Facing the "industry, University and research" gap in AI talent training, how can shengteng AI enrich the black land of industrial talents?

3.4 cloning and host time synchronization of VMware virtual machine

Build the first website with idea

Fujilai pharmaceutical has passed the registration: the annual revenue is nearly 500million yuan. Xiangyun once illegally traded foreign exchange

Zhiyun health is about to go public: long-term losses, meinian health Yu Rong has withdrawn, and it is difficult to be optimistic about the future

Obsidian基础教程
Data annotation in the second half: growth flywheel under PLG mode Manfu Technology

Wd4t secondary opening firmware 190 module for mobile hard disk data recovery is successfully repaired
随机推荐
HotSpot JVM 「01」类加载、链接和初始化
"Exclusive interview with IDC people" Suzhou Shengwang: the road of IDC transformation in the post epidemic Era
图解栈帧运行过程
24 pictures to clarify TCP at one time
Hard liver! Super detailed basic introduction to Matplotlib!!!
24 张图一次性说清楚 TCP
Factorymethod factory method
leetcode: 49. 字母异位词分组
Dio encapsulated by the flutter network request (cookie management, adding interceptors, downloading files, exception handling, canceling requests, etc.)
[WPF] XAML code skills that can be directly used for converting CAD engineering drawings to WPF
【WPF】CAD工程图纸转WPF可直接使用的xaml代码技巧
【WPF】CAD工程图纸转WPF可直接使用的xaml代码技巧
Analysis report on scale investigation and investment development suggestions of China's special equipment inspection and testing industry 2022-2028
Summary of digital image processing knowledge points
Is there any risk for CICC fortune to open an account? Is it safe to open an account?
Pat 1083 list grades (25 points)
圖解棧幀運行過程
Zhiyun health is about to go public: long-term losses, meinian health Yu Rong has withdrawn, and it is difficult to be optimistic about the future
简单好用的缓存库 gcache
What is a code baseline?