Home Database Mysql Tutorial 开启MYSQL账号的远程登陆功能_MySQL

开启MYSQL账号的远程登陆功能_MySQL

Jun 01, 2016 pm 01:47 PM
study account

bitsCN.com

xiaoz

个人的学习笔记,如有错误还请指出来,谢谢。

好长时间没写笔记了,郁闷,学习状况大不如前了。
首先,明白一点,并不是mysql禁止远程连接,而是MYSQL的账号禁止远程连接。
可能觉得我有点咬文嚼字了,不过我感觉分清这点还是很重要的。
默认情况下,所有账号都是禁止远程连接的。
(在安装MYSQL的时候,在设置ROOT密码那里有一个CHECKBOX,选中的话就开启了ROOT的远程登陆功能,默认是没被选中的)

利用

view source
print?
1 select * from mysql.user

查出所有的MYSQL用户,可以发现默认情况下,这些记录的host字段的值全都是localhost
这个host字段就是表示哪些机器可以利用此账号连接到本机的MYSQL。
localhost当然就代表本机了。。所以默认情况下别的机器无法连接。

所以要想开启一个账号的远程连接,只要将这个账号所对应的host字段改成那个IP就行。
比如:

view source
print?
1 update user set host = 192.168.230.2 where user=ninty;

执行完此命令以后还要执行:

view source
print?
1 flush privileges;

来刷新所有数据库用户的权限配置信息,让设置及时生效。
或者重启MYSQL。

将ninty这个账号的host改成192.168.230.2,这样192.168.230.2这台机器就允许通过ninty这个账号来连接到本机的MYSQL
不过用别的账号仍然是不行的。
将ninty的host改成192.168.230.2,就只有192.168.230.2这台机器可以通过ninty这个账号来连接到本机的MYSQL
其它的机器(包括本机)都无法进行连接。

如果想将一个账号设置成任何IP都可以登陆,将host改成 % 就行。
如果只能192.168.230这个网段的IP可以登陆,那就将host改成:
192.168.230.%

下面是一些常见的错误信息:
 

ERROR 1130 (00000): Host AAAAA-8HK8AISO is not allowed to connect to this MySQL server
AAAAA-8HK8AISO应该是本机的机器名,当MYSQL服务器禁止本机使用相应的账号连接的时候,就会暴这个错误。
这时换一个允许本机去连的账号就可以啦。

ERROR 1045 (28000): Access denied for user joejoe1991@TQSOFT-8HK8AISO (using password: YES)
这个错误一般就是用户名或者密码错误,这时应该是允许本机连接的, 否则报的应该是上面那个错。

ERROR 2003 (HY000): Cant connect to MySQL server on 192.168.230.2 (10061)
这个应该是网络方面的原因连不到MYSQL,可能是IP或者端口不对,或者服务器没有开启MYSQL或者防火墙挡住了连接 。

 

bitsCN.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to have multiple accounts on Xiaohongshu? How does it have traffic? How to have multiple accounts on Xiaohongshu? How does it have traffic? Mar 24, 2024 pm 03:36 PM

As a content-rich social e-commerce platform, Xiaohongshu has attracted a large number of users. For those who want to conduct multiple businesses on Xiaohongshu, it is particularly important to have multiple accounts. So, how does Xiaohongshu have multiple accounts? How can we make these accounts have traffic? This article will analyze these issues in detail and provide you with helpful guidance. 1. How to have multiple accounts on Xiaohongshu? When registering a Xiaohongshu account, you can choose to register multiple accounts using different mobile phone numbers or email addresses in order to have multiple accounts. Real-name authentication is an effective measure to improve account security and credibility. It is recommended to conduct real-name authentication for each account, so that the account will be more authoritative and credible. 3. Improve the information: Improve the information of each account, including personal homepage, header

What should I do if I can't log in to my Google Chrome account? Google account shows unable to log in solution What should I do if I can't log in to my Google Chrome account? Google account shows unable to log in solution Mar 17, 2024 am 08:30 AM

Google Chrome is a web browsing tool used by many people. In order to make it more convenient to use, some users want to log in to their Google account first, but a prompt that the account cannot be logged in appears. Regarding this issue, many users do not know what to do. How to solve it, then today the editor will share the complete solution with you. I hope that the content of today’s software tutorial can help the majority of users. Google account shows that you cannot log in. Solution: 1. Click on a browser on the desktop and you will see something like this after opening it. 2. If a login pops up at this time, click it. If you can't see it, click the upper right corner. 3. Click Login, then enter your account number. You do not need to enter the account after @, and click Next. 4. Enter the password,

How to change the mobile phone number of Xiaohongshu account? Will there be any impact if I change my mobile phone number? How to change the mobile phone number of Xiaohongshu account? Will there be any impact if I change my mobile phone number? Mar 22, 2024 am 08:11 AM

In the digital age, Xiaohongshu has become a platform for many people to share their lives and discover good things. Over time, we may need to change the mobile phone number on the account. So, how to change Xiaohongshu’s mobile phone number? 1. How to change the mobile phone number of Xiaohongshu account? 1. Log in to your Xiaohongshu account and enter the “My” page. 2. Click "..." in the upper right corner and select "Settings". 3. On the settings page, find the "Account and Security" option and click to enter. 4. On the Account and Security page, find the "Mobile Phone Number" option and click to enter. 5. At this time, the page will display the current mobile phone number, click "Change Mobile Number". 6. Enter the new mobile phone number, receive the verification code, and fill it out. 7. Set a new password to ensure account security. 8. After completing the above steps,

How do I have two Xiaohongshu accounts? What use does having two Xiaohongshu accounts do to creators? How do I have two Xiaohongshu accounts? What use does having two Xiaohongshu accounts do to creators? Mar 21, 2024 pm 10:11 PM

As a platform that integrates community, content and e-commerce, Xiaohongshu has attracted the attention of many creators and users. Some users want to have two Xiaohongshu accounts to better manage and operate different types of content. This article will explore how to create two Xiaohongshu accounts and explore the potential benefits of this approach for creators. 1. How to have two Xiaohongshu accounts? Registering a new account is very simple. Just download the Xiaohongshu APP from the mobile app store, then fill in the relevant information according to the prompts and set the nickname, avatar and password. 2. Log in to the original account: After registering a new account, you need to log out of the Xiaohongshu APP and then log in to your original account again. 3. Switch accounts: In the Xiaohongshu APP, click "My" in the lower right corner, then click the avatar and select "

What should I do if my Kuaishou account is activated abnormally? -How to turn off Kuaishou password-free payment? What should I do if my Kuaishou account is activated abnormally? -How to turn off Kuaishou password-free payment? Mar 18, 2024 pm 01:30 PM

What should I do if my Kuaishou account is activated abnormally? If your Kuaishou account is abnormal and needs to be activated, you can try the following steps to solve the problem: Try to log in again: First, make sure to log in to your Kuaishou account again with the accurate username and password. Verify the accuracy of the information entered. 2. Check network connection: Make sure your device is connected to the Internet properly. Sometimes, network problems may cause abnormal account login. 3. Check account status: If your account is banned or frozen by Kuaishou due to violations or other reasons, you need to contact Kuaishou's customer support department to solve the problem. They may require you to provide identity verification or other information to activate your account. 4. Verification code or mobile phone verification: Kuaishou may require you to conduct mobile phone verification or enter a verification code to ensure the security of your account.

Quickly master: How to open two WeChat accounts on Huawei mobile phones revealed! Quickly master: How to open two WeChat accounts on Huawei mobile phones revealed! Mar 23, 2024 am 10:42 AM

In today's society, mobile phones have become an indispensable part of our lives. As an important tool for our daily communication, work, and life, WeChat is often used. However, it may be necessary to separate two WeChat accounts when handling different transactions, which requires the mobile phone to support logging in to two WeChat accounts at the same time. As a well-known domestic brand, Huawei mobile phones are used by many people. So what is the method to open two WeChat accounts on Huawei mobile phones? Let’s reveal the secret of this method. First of all, you need to use two WeChat accounts at the same time on your Huawei mobile phone. The easiest way is to

How do I switch accounts in Xiaohongshu and it remains the same? How do I get the account switching function? How do I switch accounts in Xiaohongshu and it remains the same? How do I get the account switching function? Mar 21, 2024 pm 09:06 PM

As a popular social e-commerce platform, Xiaohongshu has attracted a large number of users. Many users may encounter the problem of needing to switch accounts when registering Xiaohongshu. So, how to switch accounts on Xiaohongshu without changing the original account? This article will answer this question in detail and help you better use Xiaohongshu. 1. How to switch accounts in Xiaohongshu so that the original account remains unchanged? 1. Open the Xiaohongshu APP and enter the personal center. 2. Click the "Settings" button in the upper right corner to enter the setting interface. 3. In the settings interface, find the "Account and Security" option and click to enter. 4. In the account and security interface, find the "Switch Account" option and click to enter. 5. Enter the password of the original account and confirm the account switch. 6. After the switch is successful, you will return to the personal center of the original account. 2. Xiaohong

How to bind a sub-account on Xiaohongshu? How does it check whether the account is normal? How to bind a sub-account on Xiaohongshu? How does it check whether the account is normal? Mar 21, 2024 pm 10:11 PM

In today's era of information explosion, the construction of personal brand and corporate image has become increasingly important. As the leading fashion life sharing platform in China, Xiaohongshu has attracted a large number of user attention and participation. For those users who want to expand their influence and improve the efficiency of content dissemination, binding sub-accounts has become an effective means. So, how does Xiaohongshu bind a sub-account? How to check whether the account is normal? This article will answer these questions for you in detail. 1. How to bind a sub-account on Xiaohongshu? 1. Log in to your main account: First, you need to log in to your Xiaohongshu main account. 2. Open the settings menu: click "Me" in the upper right corner, and then select "Settings". 3. Enter account management: In the settings menu, find the "Account Management" or "Account Assistant" option and click

See all articles