Home > Database > phpMyAdmin > body text

How to enable phpmyadmin to connect to the database remotely

Release: 2019-12-09 15:43:37
Original
2457 people have browsed it

How to enable phpmyadmin to connect to the database remotely

First, create a remote user (the root account only allows local connections. Considering security, a remote login account is generally set up)

Use the root account to log in to mysql

#mysql -u  root  -p root的密码
mysql> GRANT ALL ON *.* TO admin@'%' IDENTIFIED BY 'admin' WITH GRANT OPTION;
Copy after login

The meaning of this sentence is to allow any computer with an IP address (that’s what the % above means) to access this MySQL Server using the admin account and password (admin),

Then configure phpmyadmin Configuration file

vim ./phpMyAdmin/libraries/config.default.php
Copy after login

# is about line 125

Change $cfg['Servers'][$i]['host'] = 'localhost'

to $cfg['Servers'][$i]['host'] = 'Remote database server IP address', generally localhost can be used

Now log in to phpMyAdmin on the webpage

Enter the remote database Account and password, here are admin and admin (depending on the account and password of the remote user you created in the previous step)

Enter the database of the remote server

Recommended related articles and tutorials: phpmyadmintutorial

The above is the detailed content of How to enable phpmyadmin to connect to the database remotely. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template