我在Mac OS X Lion上,只是使用MacPorts安装了
mysql5.
然后我成功跑了:
sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
我可以启动服务器并连接为’root’,但我无法创建任何数据库.
$mysql5 -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.1.61 Source distribution
mysql> create database dbname;
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'dbname'
我已经做了很多谷歌试图解决这个问题,似乎问题可能与/ opt / local / var / db / mysql5的文件系统权限有关,但我已经尝试将这些更改为无效:
$ls -l /opt/local/var/db/
total 0
drwxrwxrwx 8 _mysql _mysql 272 Apr 12 11:55 mysql5
我已经试验了所有者是“_mysql”,“mysql”和“root:wheel”,但是没有一个有所作为.