xampp 数据库是自己的还是系统的,怎么启动和使用

由资料

“XAMPP启动数据库时,如果本地已经安装过MYSQL数据库,则无法正常启动,此时我们需要更改注册表来解决问题”

可以知道xampp数据库是集成环境的并不是系统自带的。

一、基本使用

1、打开xampp,启动MySQL服务

在这里插入图片描述

2、配置环境变量

1.下載安裝文件,官網地址:「www.apachefriends.org」
2. 输入`sudo /Applications/XAMPP/xamppfiles/xampp security`
   设置密码 
lin5-mac@AppledeMacBook-Pro ~ % sudo /Applications/XAMPP/xamppfiles/xampp security

Password:
XAMPP:  Quick security check...
XAMPP:  MySQL is accessable via network. 
XAMPP: Normaly that's not recommended. Do you want me to turn it off? [yes] yes
XAMPP:  Turned off.
XAMPP: Stopping MySQL...ok.
XAMPP: Starting MySQL...ok.

# 设置phpMyAdmin用户密码
XAMPP:  MySQL has to run before I can check the security.
XAMPP:  The MySQL/phpMyAdmin user pma has no password set!!! 
XAMPP: Do you want to set a password? [yes] yes
XAMPP: Password: 
XAMPP: Password (again): 
XAMPP:  Setting new MySQL pma password.
XAMPP:  Setting phpMyAdmin's pma password to the new one.

# 设置root密码
XAMPP:  MySQL has to run before I can check the security.
XAMPP:  MySQL has no root passwort set!!! 
XAMPP: Do you want to set a password? [yes] yes
XAMPP:  Write the password somewhere down to make sure you won't forget it!!! 
XAMPP: Password: 
XAMPP: Password (again): 
XAMPP:  Setting new MySQL root password.
XAMPP:  Change phpMyAdmin's authentication method.

# 设置FTP密码
XAMPP:  The FTP password for user 'daemon' is still set to 'xampp'. 
XAMPP: Do you want to change the password? [yes] yes
XAMPP: Password: 
XAMPP: Password (again): 
XAMPP: Reload ProFTPD...ok.
XAMPP:  Done.
3.设置mysql环境变量
  访问mysql:`/Applications/XAMPP/xamppfiles/bin/mysql -u root -p`
  输入刚刚设置的密码

  修改环境变量:
    (1)查看 `~/.bash_profile` 文件;(如果没有就是用vim 创建)
    (2)新增环境变量:
        export PATH=${PATH}:/Applications/XAMPP/xamppfiles/bin
        退出保存;
    (3)生效配置:
        source ~/.bash_profile
    (4)关闭终端,重启新终端窗口;
    (5)查看是否生效:
        echo $PATH
4.配置mysql终端路径
  需要在终端命令行操作时,比如输入:`mysql -u root -p`需要配置终端路径

  未正确配置前不会出现想要的输入密码提示,而是会提示:
  `command not found mysql`

  原因:
   当你输入命令的时候,系统会在`/usr/bin`这个位置里寻找你输入的命令,如果你没有把命令引入
   到这个位置,无论你直接cd到工具具体的位置调用,也是白费功夫的。只要把这个工具的绝对位置引
   入到`/usr/bin`,就可以了。命令执行:
   `sudo ln -s /applications/xampp/bin/mysql /usr/bin`

   假如提示你权限不够,提示`Operation not permitted`
   办法:提供权限
   `sudo ln -s /usr/local/mysql/bin/mysql /usr/bin`

   如果还是提示权限不足,则使用:
   `alias mysql=/applications/xampp/bin/mysql`

到处,就可以使用终端执行mysql了

在这里插入图片描述

二、文件修改权限丢失

按照以上修改以后,再次编辑config.inc.php文件可能失去编辑权限

原因:
一般是everyone失去读写权限,

解决办法:
只要选中文件,点击上菜单栏的显示简介-》共享与权限,点击小锁,输入密码,修改权限即可。

posted @ 2023-01-09 07:45  轻风细雨_林木木  阅读(80)  评论(0编辑  收藏  举报  来源