下载XAMPP并安装和使用(Mac环境)

数据库 专栏收录该内容
2 篇文章 0 订阅

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

  • 0
    点赞
  • 0
    评论
  • 0
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值