简体   繁体   English

如何将mysql从本地主机迁移到IP地址

[英]How to migrate mysql from localhost to IP address

I am running mysql in my localhost under the port number 3306. I want to access mysql database remotely. 我在本地主机的端口号3306下运行mysql。我想远程访问mysql数据库。 my system has the ip address and i want to use this instead of localhost. 我的系统具有ip地址,我想使用它而不是localhost。 Can you please tell me how can i achieve this one. 你能告诉我我如何做到这一点。

Have you written some code for it for accessing remote database. 您是否已为访问远程数据库编写了一些代码。 Is there any error?? 有什么错误吗? If you need to access your database remotely then you need to do following . 如果需要远程访问数据库,则需要执行以下操作。

Mysql :- MySQL的:-

 mysql> GRANT ALL ON *.* to root@'localhost' IDENTIFIED BY 'your-root-password'; 

 mysql> FLUSH PRIVILEGES;

This will grant to all users to access database remotely. 这将授予所有用户远程访问数据库的权限。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM