1.下载XAMPP
官网:
https://www.apachefriends.org/zh_cn/download.html
下载链接:
链接:https://pan.baidu.com/s/1p5MuGs62v8ma0_NrMSHlHA
提取码:p44j
百度网盘输入提取码即可直接下载。
2.安装
按照提示安装即可
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上增加用户:
————————————————
版权声明:本文为CSDN博主「KeepLearningBigData」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn. net/xubo245/article/details/117630846
转载请注明:XAMPP中文组官网 » Mac环境下载XAMPP并安装和使用教程