1.下载XAMPP
官网:
https://www.apachefriends.org/zh_cn/download.html
下载链接:
https://udomain.dl.sourceforge.net/project/xampp/XAMPP%20Mac%20OS%20X/8.0.6/xampp-osx-8.0.6-0-vm.dmg
下载了好几次才下载下来,目前速度比较慢,下了一个晚上。
2.安装
点击xampp-osx-8.0.6-0-vm.dmg按照提示安装即可
3.启动服务
4.Enable Remote Access to phpMyAdmin()
启动服务后进入HOW-TO guides:http://192.168.64.2/dashboard/docs/access-phpmyadmin-remotely.html
具体步骤:
Within this file, find the block below:
<Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Require local ...
Update this block and replace Require local with Require all granted, so that it looks like this:
<Directory "/opt/lampp/phpmyadmin"> AllowOverride AuthConfig Require all granted ...
5.访问pypmyadmin:
http://192.168.64.2/phpmyadmin/index.php?route=/server/privileges&viewing_mode=server
可以查询数据库,表和具体数据
增加表和数据:
6.使用XAMPP姿态terminal,命令行链接mysql:
/opt/lampp/bin/mysql --user=root --password=
默认密码为空。
操作历史:
root@debian:/opt/lampp/phpmyadmin# /opt/lampp/bin/mysql --user=root --password=
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 89
Server version: 10.4.19-MariaDB Source distribution
Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> show tables;
ERROR 1046 (3D000): No database selected
MariaDB [(none)]> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| phpmyadmin |
| springbootdb |
| test |
| xubo |
+--------------------+
7 rows in set (0.000 sec)
MariaDB [(none)]> use xubo
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
MariaDB [xubo]> show tables;
+----------------+
| Tables_in_xubo |
+----------------+
| test |
+----------------+
1 row in set (0.000 sec)
MariaDB [xubo]> select * from test;
+------+-----+------+------+
| name | age | data | info |
+------+-----+------+------+
| Bob | 30 | test | test |
| Bob | 30 | test | test |
+------+-----+------+------+
2 rows in set (0.000 sec)
MariaDB [xubo]>
MariaDB [xubo]> show tables;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 236
Current database: xubo
+----------------+
| Tables_in_xubo |
+----------------+
| test |
+----------------+
1 row in set (0.002 sec)
MariaDB [xubo]> select * from test;
+------+-----+------+------+
| name | age | data | info |
+------+-----+------+------+
| Bob | 30 | test | test |
| Bob | 30 | test | test |
+------+-----+------+------+
2 rows in set (0.000 sec)
7.改mysql密码:
/opt/lampp/bin/mysqladmin --user=root password "gue55me"
改了密码之后pypmyadmin默认连接不上,需要改pypmyadmin下的config.inc.php,但是发现没有权限:
所以还是改回密码为空:
/opt/lampp/bin/mysqladmin --user=root --password=12345 password ""
然后在pypmyadmin上增加用户:
参考:
【1】https://www.apachefriends.org/zh_cn/download.html