无法连接到Mysql服务器

时间:2015-10-06 18:29:27

标签: mysql macos

昨天我完全在mysql服务器上工作,但今天当我尝试使用命令连接到它时:

sudo /usr/local/mysql/bin/mysqld_safe

我收到以下错误:

151006 14:24:59 mysqld_safe Logging to '/usr/local/mysql/data/XXX-MacBook-Air.local.err'.
151006 14:24:59 mysqld_safe Starting mysqld daemon with databases from /usr/local/mysql/data
151006 14:24:59 mysqld_safe mysqld from pid file /usr/local/mysql/data/XXX-MacBook-Air.local.pid ended

我读了一些启动mysql的解决方案:

sudo /usr/local/mysql/support-files/mysql.server start

我收到错误:

Starting MySQL
. ERROR! Manager of pid-file quit without updating file.

当我按照Upgraded to OSX 10.11 El Capitan, now cannot use MySQL with Python/Django

的指示尝试卸载mysql python时

我收到错误

Exception:
Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/commands/uninstall.py", line 59, in run
requirement_set.uninstall(auto_confirm=options.yes)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1035, in uninstall
req.uninstall(auto_confirm=auto_confirm)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 598, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1836, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 295, in renames
shutil.move(old, new)
File      "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py"  , line 300, in move
rmtree(src)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 252, in rmtree
onerror(os.remove, fullname, sys.exc_info())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 250, in rmtree
os.remove(fullname)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/MySQL_python-1.2.5-py2.7.egg-info/dependency_links.txt'

Storing debug log for failure in /Users/Fatima/Library/Logs/pip.log

在尝试解决问题后,我尝试再次从http://dev.mysql.com/downloads/mysql/安装Mysql。现在我可以连接到没有错误的数据库但是当我尝试访问我的数据库时出现错误

MySQL said: Access denied for user ''@'localhost' to database 'mysql'

当我测试与db的连接时,我得到“无效的数据库”。当我再次安装mysql时,我以前的数据库被删除了吗?

0 个答案:

没有答案
相关问题