我试图安装自制软件,而且非常非常愚蠢地做到这一点:
sudo chown -R $USER /usr/local
自制软件指令说要做到这一点,我不是一个系统pipe理员,所以我采取了他们的话。 获得的教训(虽然我真的不知道如何testing这个…看起来像一个“撤消”脚本将在这里超级宝贵)
无论如何,做完了,但现在我得到这个错误:
$ mysql -u root -p Enter password: Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 548 Server version: 5.1.33 Source distribution Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show databases; ERROR 1018 (HY000): Can't read dir of '.' (errno: 13)
我无济于事尝试回到根源。 有谁知道我可以解决这个问题,而无需重新安装MySQL? 或者,如果我必须重新安装MySQL,我怎么能转储我的数据库而不访问命令行,所以我不会失去所有的数据。
谢谢!
findMySQL的数据目录,并将其input到MySQL的用户(通常是mysql:mysql)…
确定什么用户mysql正在运行(我会使用ps aux |grep mysql
,但是你的标志到ps可能会有所不同),find安装mysql的位置(我的ps结果显示为--datadir=/usr/local/mysql/data
,但是您可能需要屏幕足够宽,以免截断命令),然后将所有权更改回正确的用户。
$ cd /usr/lcoal/mysql/ $ ls -l $ sudo -R chown mysql:mysql data/
data/
是包含所有数据库的/usr/local/mysql/
下的一个目录。
现在执行mysql -u user -p password
。 你可以访问你的数据库