xampp's mysql

本文介绍了在本地环境中使用XAMPP安装Drupal过程中遇到的MySQL访问权限问题及其解决方案。作者发现XAMPP自带的MySQL并未启动,并解决了因旧版MySQL服务导致的问题。此外,还详细说明了如何配置phpMyAdmin的连接参数以确保正确访问。

I want to try drupal again locally. This artical gives good introduction for the installation: http://drupal.org/node/307956.


XAMPP's installation is ok. When I run it, I can see that I have started both Apache and MySql. However, when I run "http://localhost/phpmyadmin.", I got the error page "#1045 – Access denied for user ‘pma’@'localhost’ (using password: NO)".


Wasted me so much time, and then I realized that:

1) The MySql coming with XAMPP does not start actually. I had one old MySql installed long time ago in my computer, and it got started (as a Window service) every time when I click the start button on XAMPP panel.

Solution: I stop the service, and go to XAMPP directory and click directly the file "C:\xampp\mysql_start.bat" to start the correct MySql of XAMPP. Now I can see that "MySQL database" is in "ACTIVATED" status on the "XAMPP Status" page.

2) Check the configuration file: "C:\xampp\phpMyAdmin\config.inc.php". If you have set up a new password for root user, you need to change the values of both entires in this file. Suppose that the password is "1234", you need to change the following. In the beginning, I just changed the first one, and it did not work.

$cfg['Servers'][$i]['password'] = '1234';

$cfg['Servers'][$i]['controlpass'] = '1234';


Now the "phpMyAdmin" can be used!





### 如何在 Mac OS XAMPP 中启动 MySQL 服务 对于在 Mac 上运行 XAMPP 并遇到 MySQL 服务无法启动的情况,有几种方法可以帮助解决问题。 #### 方法一:创建软链接 一种常见的解决方案是在特定路径下创建指向 `mysql.server` 的软链接。这可以通过执行以下命令来完成: ```bash sudo ln -s /Applications/XAMPP/xamppfiles/share/mysql/mysql.server /Applications/XAMPP/xamppfiles/bin/mysql.server ``` 这条指令使得通过命令行管理 MySQL 变得更加方便[^1]。 #### 方法二:处理端口冲突 有时 MySQL 启动失败的原因可能是由于端口被占用。为了确认这一点,在终端中输入如下命令查看是否有程序正在使用默认的 MySQL 端口号 (3306): ```bash sudo lsof -i :3306 ``` 如果有其他应用程序占用了该端口,则需要停止这些应用或更改 MySQL 配置文件中的监听端口设置[^4]。 #### 方法三:绕过权限验证重启数据库 当忘记了 root 用户密码或者其他安全配置阻碍了正常的访问时,可以采用临时忽略授权表的方式启动 MySQL: ```bash /Applications/XAMPP/xamppfiles/bin/mysqld_safe --skip-grant-tables & ``` 请注意这种方式仅用于恢复目的,并应在完成后立即恢复正常的安全模式[^3]。 #### 方法四:考虑操作系统特性的影响 值得注意的是,在较新的 macOS 版本中启用了名为 SIP(System Integrity Protection) 或 Rootless 的功能,它可能会干扰某些低级别操作。如果上述措施均未奏效,可能需要进一步调查是否与此有关联并采取相应对策[^5]。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值