phpMyAdmin 是一个以PHP为基础,以Web-Base方式架构在网站主机上的MySQL的数据库管理工具,让管理者可用Web接口管理MySQL数据库。
[root@localhost ~]# cd /usr/local/src/
[root@localhost src]# wget https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.zip //首先下载包
--2022-08-03 18:40:43-- https://files.phpmyadmin.net/phpMyAdmin/5.2.0/phpMyAdmin-5.2.0-all-languages.zip
Resolving files.phpmyadmin.net (files.phpmyadmin.net)... 89.187.187.12, 2a02:6ea0:c800::8
Connecting to files.phpmyadmin.net (files.phpmyadmin.net)|89.187.187.12|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 14112668 (13M) [application/zip]
Saving to: 'phpMyAdmin-5.2.0-all-languages.zip'
phpMyAdmin-5.2.0-all 100%[====================>] 13.46M 2.59MB/s in 6.3s
2022-08-04 10:40:52 (2.13 MB/s) - 'phpMyAdmin-5.2.0-all-languages.zip' saved [14112668/14112668]
[root@localhost src]# unzip phpMyAdmin-5.2.0-all-languages.zip //解压包
[root@localhost src]# ls phpMyAdmin-5.2.0-all-languages
CONTRIBUTING.md composer.lock libraries templates
ChangeLog config.sample.inc.php locale themes
LICENSE doc package.json url.php
README examples robots.txt vendor
RELEASE-DATE-5.2.0 favicon.ico setup yarn.lock
babel.config.json index.php show_config_errors.php
composer.json js sql
[root@localhost src]# rm -rf /usr/local/apache/htdocs/homepage/index.php
[root@localhost src]# mv phpMyAdmin-5.2.0-all-languages/* /usr/local/apache/htdocs/homepage/ //把此目录下的所有文件进行导入
[root@localhost src]# cd
[root@localhost ~]# mysql -uroot -p123456 //我们授权一个远程登录用户
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.7.38
Copyright (c) 2000, 2022, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> set password = password('wangquan');
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> select user,host from mysql.user;
+---------------+-----------+
| user | host |
+---------------+-----------+
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+---------------+-----------+
3 rows in set (0.00 sec)
mysql> grant all on *.* to "root"@"%" identified by '123456';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> select user,host from mysql.user;
+---------------+-----------+
| user | host |
+---------------+-----------+
| root | % |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+---------------+-----------+
4 rows in set (0.00 sec)
mysql> exit
Bye
[root@localhost ~]# systemctl restart httpd.service
[root@localhost ~]# mysql -uroot -pwangquan -e "create database wq;" //创建一个库
mysql: [Warning] Using a password on the command line interface can be insecure.
测试,已在虚拟机添加一个wq数据库,在网页刷新查看